mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
add server to monorepo.
This commit is contained in:
28
packages/server/src/server.ts
Normal file
28
packages/server/src/server.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'reflect-metadata'; // We need this in order to use @Decorators
|
||||
import '@/config';
|
||||
import './before';
|
||||
|
||||
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();
|
||||
Reference in New Issue
Block a user