https://github.com/luispagarcia/jwt-api
Ejemplo suuuuuuper pato de como usar JWT
https://github.com/luispagarcia/jwt-api
example jwt node simple
Last synced: 5 months ago
JSON representation
Ejemplo suuuuuuper pato de como usar JWT
- Host: GitHub
- URL: https://github.com/luispagarcia/jwt-api
- Owner: LuisPaGarcia
- Created: 2018-10-19T02:05:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-19T02:15:07.000Z (over 7 years ago)
- Last Synced: 2025-09-07T01:02:24.881Z (5 months ago)
- Topics: example, jwt, node, simple
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jwt-api
## Instala las dependencias
```shell
$ npm i
```
o
```shell
$ yarn
```
## Ejecuta con 2 variables de ambiente, PORT y secret
```shell
$ PORT=3000 secret=secretohehe node index.js
```
## Genera JWT
- Entra a localhost:3000/token y obtén tu token
## Utiliza el JWT
- Entra a localhost:3000/api
- No podrás entrar
- Ahora entra a localhost:3000/api?token=EL_TOKEN_
Listo 💯