20 lines
479 B
TypeScript
20 lines
479 B
TypeScript
require('dotenv').config();
|
|
import express, { NextFunction, Request, Response } from 'express';
|
|
import config from 'config';
|
|
import cors from 'cors';
|
|
import { AppDataSource } from './db/data-source';
|
|
import AppError from './errors/appError';
|
|
|
|
|
|
|
|
|
|
AppDataSource.initialize()
|
|
.then(async () => {
|
|
|
|
const app = express();
|
|
|
|
app.all('*', (req: Request, res: Response, next: NextFunction) => {
|
|
next(new AppError(404, `Route ${req.originalUrl} not found`));
|
|
});
|
|
|
|
})
|