-
Notifications
You must be signed in to change notification settings - Fork 637
Expand file tree
/
Copy pathapp.js
More file actions
18 lines (13 loc) · 674 Bytes
/
app.js
File metadata and controls
18 lines (13 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Importing required packages
const http = require('http');
const express = require('express');
const app = express();
app.set('port', process.env.PORT || 3000); // Application port is set
app.set('views', __dirname + '/app/server/views'); // Views folder is set
app.set('view engine', 'ejs'); // View engine is set
app.use(express.static(__dirname + '/app/public')); // Public folder containing static files is set
require('./app/routes')(app); // Routes are imported
const server = http.createServer(app).listen(app.get('port'), function(){
console.log('The application is running on port ' + app.get('port'));
}); // Http server is created
module.exports = server;