mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 16:19:26 +00:00
Set up expressjs framework
This commit is contained in:
22
app.js
Normal file
22
app.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
// Import required modules
|
||||
const express = require('express');
|
||||
|
||||
// Import user defined modules
|
||||
const importJSON = require('./lib/importJSON');
|
||||
|
||||
async function main() {
|
||||
// Import server config file
|
||||
const serverOptions = importJSON('server');
|
||||
|
||||
// Initialise up express app
|
||||
const app = express();
|
||||
|
||||
// Start the server
|
||||
app.listen(serverOptions.port, () => {
|
||||
console.log(`Server listening on :${serverOptions.port}`);
|
||||
});
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
||||
Reference in New Issue
Block a user