implement JWT tokens, regenerate docs and sqlc
This commit is contained in:
@@ -2,6 +2,19 @@
|
||||
|
||||
Music collection software for indexing bought (physical) albums. Build with Golang and Postgres
|
||||
|
||||
## Authentication
|
||||
JWT authentication is enabled for protected endpoints.
|
||||
|
||||
Set these environment variables for the API:
|
||||
|
||||
- `JWT_SECRET` (required)
|
||||
- `JWT_ISSUER` (optional, defaults to `music-index-api`)
|
||||
- `JWT_TTL_MINUTES` (optional, defaults to `60`)
|
||||
|
||||
Get a token via `POST /api/v1/users/login` and include it as:
|
||||
|
||||
`Authorization: Bearer <token>`
|
||||
|
||||
## Swagger
|
||||
The API documentation is available at [/api/v1/swagger/index.html](http://localhost:8080/api/v1/swagger/index.html) after running the application. It provides details about the available endpoints, request/response formats, and other relevant information for developers to interact with the API effectively.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user