15 lines
351 B
TypeScript
15 lines
351 B
TypeScript
import dotenv from 'dotenv';
|
|
|
|
import app from './app';
|
|
import { connection } from './database/database.connection';
|
|
import { PORT as DEFAULT_PORT } from './constants/defaults';
|
|
|
|
dotenv.config();
|
|
|
|
const PORT: number = Number(process.env.PORT) || DEFAULT_PORT;
|
|
|
|
connection.then(
|
|
() => app.listen(PORT),
|
|
(err) => console.error('ERROR!', err),
|
|
);
|