update readme
This commit is contained in:
parent
17ae90ec05
commit
5912b5c6d3
13
README.md
13
README.md
|
@ -4,7 +4,6 @@ Go-JWTServer met a disposition :
|
|||
- Un serveur de stockage de utilisateur sous postgres et d'authenfication Jwt
|
||||
- Un middleware d'authentification Jwt
|
||||
|
||||
Dépendances: docker, docker-compose
|
||||
## Serveur
|
||||
|
||||
### Configuration
|
||||
|
@ -26,10 +25,12 @@ token_password="NotSoSecretJwtSecretPassword"
|
|||
|
||||
### Executer le serveur
|
||||
Lancer le conteneur postgres
|
||||
|
||||
```make up```
|
||||
|
||||
|
||||
Dans une autre console, lancer le serveur jwt
|
||||
|
||||
```make run```
|
||||
|
||||
## Middleware
|
||||
|
@ -39,16 +40,16 @@ de vérifier la validité du token Jwt
|
|||
##### Exemple
|
||||
|
||||
```
|
||||
r := chi.NewRouter()
|
||||
r := chi.NewRouter()
|
||||
|
||||
//add Jwt Authentification
|
||||
r.Use(jwtmiddleware.JwtAuthentication)
|
||||
//add Jwt Authentification
|
||||
r.Use(jwtmiddleware.JwtAuthentication)
|
||||
|
||||
.Route("/api/", func(r chi.Router) {
|
||||
.Route("/api/", func(r chi.Router) {
|
||||
//Middleware routes
|
||||
r.Post("/user/new", jwtmiddleware.CreateAccount)
|
||||
r.Post("/user/login", jwtmiddleware.Authenticate)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
## API
|
||||
|
|
Loading…
Reference in New Issue