A simple middleware written in go. This is a learning exercise project. The idea is to write a simple middleware in which i'm applying the concepts as i learn them. At the moment of this writing, the middleware is able to:
- Serve static files
- Serve dynamic content
- Handle GET and POST requests
- Log all requests
- Validate the request method
New features will be added as i learn them.
On linux:
./buildxc.sh
On windows:
NOT IMPLEMENTED YET
The executable will be in the build/ folder.
The server can be started simply by running the executable.
On linux:
- Copy the executable to a folder in your PATH.
- Run the executable.
On linux (assuming the executable is in your PATH):
mw-server
else
./mw-server
On windows:
./mw-server.exe
The server can be accessed on port 8080.
The server has 4 endpoints:
Endpoint | Description |
---|---|
/hello | Returns a simple hello world message |
/contactme | Returns a simple contact me form |
/static/ | Returns a static file |
/api/contactme | Returns a json response |