23 lines
628 B
TypeScript
23 lines
628 B
TypeScript
import * as dotenvSafe from 'dotenv-safe';
|
|
import express from 'express';
|
|
import consola from 'consola';
|
|
import * as jwt from 'jsonwebtoken';
|
|
import { createConnection } from 'typeorm';
|
|
import bodyparser from "body-parser";
|
|
import 'reflect-metadata';
|
|
import routerMain from './routes/index';
|
|
// const loaders = require('./loaders');
|
|
import loaders from './loaders/index';
|
|
|
|
dotenvSafe.config();
|
|
let app = express();
|
|
const PORT = process.env.APP_PORT || 4010;
|
|
|
|
async function main() {
|
|
await loaders(app);
|
|
app.listen(PORT, () => {
|
|
consola.success(`⚡️[server]: Server is running at http://localhost:${PORT}`);
|
|
});
|
|
}
|
|
|
|
main() |