Easy to follow boilerplate for a Golang webserver with authentication.
- Mux (Routing)
- Crypto (Hashig passwords)
- Gorm (Go ORM)
- JWT GO (Authentication)
- SQL Lite Drivers
Basic CRUD Routes for User Data
- Show Users
GET /users
- Create User
POST /users
- Show User
GET /users/{userId}
- Delete User
DELETE /users/{userId}
- Update User
PUT /users/{userId}
- User Login
POST /users/login
Create a .env
file with the following parameters. For SQL Lite only port and JWT secret are required.
PORT = ...
ENVIRONMENT = ...
DB_HOST = ...
DB_NAME = ...
DB_USERNAME = ...
DB_PASSWORD = ...
JWT_SECRET = ...
Run the command to install all dependancies.
go mod download
This project is licensed under the MIT License - see the LICENSE file for details