The GOP Server is an open-source web server for Linux and Windows systems that handles HTTP requests to scripts programmed in Go returning the result of the execution to the client. The software is able to, depending on the requested path, return static files or execute Go scripts, which are compiled on the fly and have specific functionality.

Golang Preprocessor for Web Services - GOP Server

Introduction

The GOP Server is an open-source web server for Linux and Windows systems that handles HTTP requests to scripts programmed in Go returning the result of the execution to the client.

The software is able to, depending on the requested path, return static files or execute Go scripts, which are compiled on the fly and have specific functionality. This functionality is transparently embedded by the GOP Server into the script files to provide them with functions inherent to web application development such as URL parameter management, cookie management, session management, includes a library of basic functions and database support.

GOP scripts are .gop files coded in Go but that follow the GOP specification, a superset of Go defined to integrate the extra functionality provided by the server.

In summary, the server allows to easily develop web applications programmed in Go with the comfort and functionality analogous to PHP, which makes it a multipurpose tool capable of being used both in educational environments to learn the language and in development and production environments for web applications or HTTP APIs.

Disclaimer

The software has just been released an has to be considered as beta, as might contain bugs and/or security vulnerabilities. Audit the code before using it in production enviroments. The software is provided as is without warranty of any kind.

How to run

The steps are simple: install Golang, clone the repository and execute from source (go run).

Then, place your files under the /public directory and access them from http://localhost:80.

Windows Prerequisites

Install Golang from https://golang.org/doc/install

Clone the repository.

Edit the configuration if needed (config/configuration.json)

Open a terminal inside the GOP-Server folder.

Linux Prerequisites

sudo apt update
sudo apt install golang
git clone https://github.com/i-rme/GOP-Server.git
cd GOP-Server
nano config/configuration.json

Linux

sudo go run src/main.go

Windows

go run src/main.go

WSL

wsl sudo go run src/main.go

Optional Settings

Enable database support by setting MySQLSupportEnabled to true in the config file.

Enable privilege downgrade by setting RunScriptsAsNobody to true in the config file.

Important paths

Configuration file: ./config/configuration.json

Default document root: ./public

Default log directory: ./logs

Default uploads directory: ./private/uploads

CMS Example database details: ./public/examples/cms/components/repository.gop

Troubleshooting

Error: CreateFile src/main.go: The system cannot find the path specified. when launching the GOP Server with go run.

Solution: Navigate to the GOP-Server directory before launching. cd GOP-Server

Error: "no required module provides package" when MySQL support is enabled.

Solution: Install the missing package using go get github.com/go-sql-driver/mysql

Error: "listen tcp 127.0.0.1:80: bind: permission denied" when starting the server on linux.

Solution: Run the server with root privileges sudo go run src/main.go

Architecture

Architecture

Owner
Raúl Martínez (RME)
Find me on Twitter @ RME
Raúl Martínez (RME)
Similar Resources

Fishserver is designed to quickly add HTTP handlers to HTTP servers. It supports registration of various HTTP

Fishserver is designed to quickly add HTTP handlers to HTTP servers. It supports registration of various HTTP

Fishserver is designed to quickly add HTTP handlers to HTTP servers. It supports registration of various HTTP. Handler interface types such as Gin Engine, Go's built-in HTTP. HandlerFunc, or http.ServeMux. The HTTP server can be configured quickly with options and can be used for test cases.

Nov 1, 2021

A local server with real-time reload function designed for static website preview or development

中文 | English 📝 介绍 reserver 是一款为静态网站预览或开发设计的具有实时重新加载功能的本地服务器。 其主要运用场景为: 单页应用的预览(例如Vue编译之后的项目不可以直接通过file://协议进行访问) 具有ajax请求的页面(因浏览器安全限制,默认禁止file://协议进行

Aug 23, 2022

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact.

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact.

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact. It provides feature flags, experimentation (A/B testing), and dynamic configuration. It has clear swagger REST APIs for flags management and flag evaluation.

Dec 25, 2022

The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat

The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat

The Zuri Core is an open-source API that serves as the backend and backbone of Zuri Chat

Dec 26, 2022

An open-source, on-prem feature flag solution

An open-source, on-prem feature flag solution

An open-source, on-prem feature flag solution Documentation | Features | Values | Examples | Enterprise Flipt is an open source, on-prem feature flag

Dec 24, 2022

Go package for the BeagleBone open source hardware

go-beaglebone Go package for the BeagleBone open source hardware Also check out https://github.com/SpaceLeap/go-embedded This package builds on top of

Jul 6, 2019

A simple HTTP Server to share files over WiFi via Qr Code

A simple HTTP Server to share files over WiFi via Qr Code

go-fileserver A simple HTTP server to share files over WiFi via QRCode Installation You can download compressed version from

Oct 8, 2022

:tophat: Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support

:tophat: Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support

Web server with built-in support for QUIC, HTTP/2, Lua, Markdown, Pongo2, HyperApp, Amber, Sass(SCSS), GCSS, JSX, BoltDB (built-in, stores the databas

Jan 1, 2023

HTTP Echo is a go web server that echos back the arguments given to it.

HTTP Echo is a go web server that echos back the arguments given to it. This is especially useful for demos or a more extensive "hello world" application in Docker or Kubernetes.

Jan 3, 2023
✨ A lightweight HTTP server based on GO, will try to detect your OS and architecture and return as SHELL script. ✨
✨ A lightweight HTTP server based on GO, will try to detect your OS and architecture and return as SHELL script. ✨

✨ A lightweight HTTP server based on GO, will try to detect your OS and architecture and return as SHELL script. ✨

Dec 14, 2022
Static Content Web Server

Static Content Web Server The main purpose of the project is to develop static server that can be used with modern javascript frameworks (React, vue.j

Dec 17, 2021
Opinionated boilerplate Golang HTTP server with CORS, OPA, Prometheus, rate-limiter for API and static website.
Opinionated boilerplate Golang HTTP server with CORS, OPA, Prometheus, rate-limiter for API and static website.

Teal.Finance/Server Opinionated boilerplate HTTP server with CORS, OPA, Prometheus, rate-limiter… for API and static website. Origin This library was

Nov 3, 2022
A simple Go HTTP server that proxies RPC provider requests

go-rpc-provider-proxy A simple Go HTTP server that proxies RPC provider requests.

Nov 21, 2021
RoadRunner: an open-source high-performance PHP application server, load balancer, and process manager
RoadRunner: an open-source high-performance PHP application server, load balancer, and process manager

RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports running as a serv

Jan 13, 2022
CasaOS - A simple, easy-to-use, elegant open-source home server system.
CasaOS - A simple, easy-to-use, elegant open-source home server system.

CasaOS - A simple, easy-to-use, elegant open-source home server system. CasaOS is an open-source home server system based on the Docker ecosystem and

Jan 8, 2023
Go web server - A web server that can accept a GET request and serve a response.

go_web_server A web server that can accept a GET request and serve a response. Go is a great language for creating simple yet efficient web servers an

Jan 3, 2022
Gin Server Demo, with Features: Swagger UI, Prometheus, Shell scripts

Gin Server Gin Server Features Swagger UI Docker Prometheus Shell generator Production Cypher Service And we can get the authorization key SECURITY_CA

Nov 1, 2021
a simple http server as replacement of python -m http.server

ser a simple http server as replacement of python -m http.server

Dec 5, 2022
A very simple Golang server handling basic GET and POST requests

GOLANG SERVER INTRO As a true Blockchain enthusiast, I had to learn Solidity and Golang to participate to several projects. This repository consists o

Nov 17, 2021