Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Last active June 8, 2025 21:48
Show Gist options
  • Save codigoconjuan/7090575ba34bc936f3ebef0bf7fac886 to your computer and use it in GitHub Desktop.
Save codigoconjuan/7090575ba34bc936f3ebef0bf7fac886 to your computer and use it in GitHub Desktop.
Gist Express Servidor
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}`))
})
"scripts": {
"dev": "nodemon src/index.ts",
"dev:api": "nodemon src/index.ts --api",
"build": "tsc",
"start": "node ./dist/index.js"
},
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
{
"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"]
}
@tatatadlisixti4
Copy link

uwu arigato gozaimasu :)

@david-londono
Copy link

gracias!

@SoyLuisReyes
Copy link

Gracias!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment