update Readme
This commit is contained in:
parent
6b7b5f2ae9
commit
c3e3b1344f
1 changed files with 12 additions and 2 deletions
14
README.md
14
README.md
|
|
@ -18,14 +18,24 @@ Easily extendible RESTful API boilerplate aiming to follow idiomatic go and best
|
|||
- Clone this repository
|
||||
- Create a postgres database and set environment variable *DATABASE_URL* accordingly if not using same as default
|
||||
- Build the application: ```go build``` to create ```go-base``` binary or use ```go run main.go``` instead in the following commands
|
||||
- Run ```go-base``` for cobra generated help message.
|
||||
- Initialize the database migrations table: ```go-base migrate init```
|
||||
- Run all migrations found in ./database/migrate with: ```go-base migrate```
|
||||
- Run the application: ```go-base serve```
|
||||
|
||||
Run ```go-base``` only to see the cobra generated help message.
|
||||
|
||||
### API Routes
|
||||
|
||||
For passwordless login following routes are available:
|
||||
|
||||
Path | Method | Required JSON | Header | Description
|
||||
---|---|---|---|---
|
||||
/auth/login | POST | email | | the email you want to login with (see below)
|
||||
/auth/token | POST | token | | the token you received via email (or printed to stdout if smtp not set)
|
||||
/auth/refresh | POST | | Authorization: "Bearer refresh_token" | refresh JWTs
|
||||
/auth/logout | POST | | Authorizaiton: "Bearer refresh_token" | logout from this device
|
||||
|
||||
Besides /auth/* the API provides to main routes /api/* and /admin/* to distinguish between application and administration features. The latter requires to be logged in as administrator by providing the respective JWT in Authorization Header.
|
||||
|
||||
Check [routes.md](routes.md) file for an overview of the provided API routes.
|
||||
|
||||
#### Demo client application
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue