-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (22 loc) · 884 Bytes
/
server.js
File metadata and controls
29 lines (22 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//Required denpendencies we are pull IN
var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');
//express app configuration
var app = express();
var PORT = process.env.PORT || 3000;
//Setting up the Express app to handle data parsing
app.use(express.static(path.join(__dirname, './app/public')));
//Add middleware for parsing incoming request username
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.text());
//Router
// require('./app/routing/apiRoutes.js')(app);
// require('./app/routing/htmlRoutes.js')(app);
require(path.join(__dirname, './app/routing/apiRoutes'))(app);
require(path.join(__dirname, './app/routing/htmlRoutes'))(app);
//Starts the server to begin listening
app.listen(PORT, function() {
console.log('Friend Finder app is listening on PORT: ' + PORT);
});