mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-11 18:30:30 +00:00
29 lines
659 B
TypeScript
29 lines
659 B
TypeScript
import 'reflect-metadata'; // We need this in order to use @Decorators
|
|
import './before';
|
|
import '@/config';
|
|
|
|
import express from 'express';
|
|
import loadersFactory from 'loaders';
|
|
|
|
async function startServer() {
|
|
const app = express();
|
|
|
|
// Intiialize all registered loaders.
|
|
await loadersFactory({ expressApp: app });
|
|
|
|
app.listen(app.get('port'), (err) => {
|
|
if (err) {
|
|
console.log(err);
|
|
process.exit(1);
|
|
return;
|
|
}
|
|
console.log(`
|
|
################################################
|
|
Server listening on port: ${app.get('port')}
|
|
################################################
|
|
`);
|
|
});
|
|
}
|
|
|
|
startServer();
|