19 lines
384 B
TypeScript
19 lines
384 B
TypeScript
import express, { json } from 'express';
|
|
import { handleError } from './utils/errorHandler'
|
|
import 'dotenv/config'
|
|
|
|
import { router } from './routes'
|
|
|
|
const app = express();
|
|
|
|
const port = process.env.PORT || 3000;
|
|
|
|
app.use(json({ limit: '100kb' }))
|
|
|
|
app.use(router)
|
|
|
|
app.use(handleError)
|
|
app.listen(port, () => {
|
|
console.log(`App is running on port http://localhost:${port}`);
|
|
})
|