small server refactor

This commit is contained in:
Jonathan Barrow
2021-04-23 18:10:33 -04:00
parent 481b051213
commit 9a4293b37c
2 changed files with 8 additions and 6 deletions

View File

@@ -2,9 +2,9 @@
"name": "website",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "src/server.js",
"scripts": {
"start": "node src/index.js"
"start": "node src/server.js"
},
"repository": {
"type": "git",

View File

@@ -1,9 +1,11 @@
process.title = 'Pretendo - Website';
const logger = require('./logger');
const express = require('express');
const handlebars = require('express-handlebars');
const config = require('../config.json');
const cfg = require('../config.json');
const { http: { port } } = config;
const app = express();
const routers = {
@@ -51,6 +53,6 @@ app.set('view engine', 'handlebars');
app.use(express.static('public'));
app.listen(cfg.http.port, () => {
logger.info(`Server listening on *:${cfg.http.port}`);
app.listen(port, () => {
logger.success(`Server listening on *:${port}`);
});