https://github.com/csdev19/express-api-example
Ejemplo de una API en express usando passport para a autentificaciones stateless
https://github.com/csdev19/express-api-example
Last synced: 3 days ago
JSON representation
Ejemplo de una API en express usando passport para a autentificaciones stateless
- Host: GitHub
- URL: https://github.com/csdev19/express-api-example
- Owner: csdev19
- Created: 2021-01-19T19:05:40.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-03T02:06:43.000Z (almost 5 years ago)
- Last Synced: 2025-01-25T23:43:58.730Z (11 months ago)
- Language: JavaScript
- Size: 85.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express API example
Esta es el ejemplo de un backend hecho en express usando:
- Mongoose
- Passport
- JWT
- Eslint
## Como usar Eslint
[Eslint](https://eslint.org/docs/user-guide/getting-started)
## Ejemplo de peticion HTTP por JS con Bearer
```js
fetch("http://localhost:8089/protected", {
"method": "GET",
"headers": {
"Bearer": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImNyaXN0aWFuc290b21heW9yMTkxMkBnbWFpbC5jb20iLCJpc0xvZ2VkIjp0cnVlLCJpYXQiOjE2MTEyMDAxMjMsImV4cCI6MTYxMTIwMTYyM30.ZPspcTr6ioPeJ7LJ36HE2HB-L4Dgv7w0OZiggeJ4Lys",
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImNyaXN0aWFuc290b21heW9yMTkxMkBnbWFpbC5jb20iLCJpc0xvZ2VkIjp0cnVlLCJpYXQiOjE2MTEyMDAxMjMsImV4cCI6MTYxMTIwMTYyM30.ZPspcTr6ioPeJ7LJ36HE2HB-L4Dgv7w0OZiggeJ4Lys"
}
})
.then(response => {
console.log(response);
})
.catch(err => {
console.error(err);
});
```
## Contribuidores
- Cristian Sotomayor