A simple HTTP server written in Go to demonstrate secure request handling using JWT (JSON Web Tokens). The project keeps dependencies minimal, using only .env and jwt libraries.
- Clone the repository:
git clone https://github.com/ledavid/SimpleServer.git
- Add a
.envfile with:SECRET_KEY=your_jwt_secret_key
- Run the server:
go run ./cmd/SimpleServer/main.go
GET /home- Home route (protected with JWT authorization).POST /login- Login and get a token. The body must provide the next json: {"email": , "password" }GET /refrehs- Refresh your token. The body must provide the last refreshToken in the body