21 lines
428 B
TypeScript
21 lines
428 B
TypeScript
import express, { Application } from 'express'
|
|
import { createServer } from 'http'
|
|
import testRouter from './api/routes/testRoutes'
|
|
|
|
const app: Application = express()
|
|
const server = createServer(app)
|
|
const PORT: number = 9000
|
|
|
|
app.use(express.json())
|
|
|
|
// Rutas
|
|
app.use('/test', testRouter)
|
|
|
|
const startServer = (): void => {
|
|
server.listen(PORT, () => {
|
|
console.log(`Server running on port ${PORT}`)
|
|
})
|
|
}
|
|
|
|
startServer()
|