https://github.com/csdev19/express-ts-example
Proyecto de ejemplo de un backend con express usando TS y demas cosillas
https://github.com/csdev19/express-ts-example
Last synced: 20 days ago
JSON representation
Proyecto de ejemplo de un backend con express usando TS y demas cosillas
- Host: GitHub
- URL: https://github.com/csdev19/express-ts-example
- Owner: csdev19
- License: mit
- Created: 2021-04-21T20:56:09.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-21T21:18:29.000Z (about 5 years ago)
- Last Synced: 2025-01-25T23:44:02.502Z (over 1 year ago)
- Language: TypeScript
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Express TS
Este es un modelo de backend construido con typescript en express usando un modelo mas relacionado a objetos para que sea mejor mantenido. A su vez se usan conceptos como DataMappers, DTO, etc.
Componentes usados:
- Mongoose
- Passport
- JWT
- Eslint
- Docker
- dotenv
## 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