An open API service indexing awesome lists of open source software.

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

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 💯