https://github.com/blend/simple-server
A simple web server written in Go
https://github.com/blend/simple-server
Last synced: about 1 year ago
JSON representation
A simple web server written in Go
- Host: GitHub
- URL: https://github.com/blend/simple-server
- Owner: blend
- Created: 2021-02-12T22:37:38.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-09T21:23:56.000Z (about 5 years ago)
- Last Synced: 2024-03-26T12:59:02.706Z (about 2 years ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 44
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Web Server
A simple web server written in Go. The server exposes the following endpoints:
- `/` responds with `echo`
- `/headers` responds with the request headers in JSON
- `/env` responds with the environment variables in JSON
- `/encrypt` responds with an encrypted message
- `/decrypt/` responds with the plaintext of ``
## How to run
1. Install Go https://golang.org/doc/install.
2. Clone this repository and `cd` into the directory.
3. Build the server with `go build -o bin/server main.go`.
4. Run `bin/server`.
5. Test the connection by requesting `http://localhost/`, e.g. `curl http://localhost`.
## Configuration
### Command-line arguments
- `-host` the host to listen on (defaults to `127.0.0.1`)
- `-port` the port to listen on (defaults to `80`)
- `-config` the server config file in JSON format (defaults to `config.json`)