Last active
June 8, 2025 21:48
-
-
Save codigoconjuan/7090575ba34bc936f3ebef0bf7fac886 to your computer and use it in GitHub Desktop.
Gist Express Servidor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import colors from 'colors' | |
import server from './server' | |
const port = process.env.PORT || 4000 | |
server.listen(port, () => { | |
console.log( colors.cyan.bold( `REST API en el puerto ${port}`)) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"dev": "nodemon src/index.ts", | |
"dev:api": "nodemon src/index.ts --api", | |
"build": "tsc", | |
"start": "node ./dist/index.js" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express' | |
import colors from 'colors' | |
import morgan from 'morgan' | |
const app = express() | |
app.use(morgan('dev')) | |
app.use(express.json()) | |
export default app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"outDir": "./dist", | |
"rootDir": "./src", | |
"lib": ["esnext"], | |
"target": "ESNext", | |
"moduleResolution": "NodeNext", | |
"module": "NodeNext", | |
"strict": false, | |
"sourceMap": true, | |
"esModuleInterop": true, | |
"declaration": true, | |
"experimentalDecorators": true, | |
"emitDecoratorMetadata": true, | |
}, | |
"include": ["src/**/*.ts"] | |
} |
gracias!
Gracias!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
uwu arigato gozaimasu :)