forked from mocp-me/mocp_me
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
31 lines (22 loc) · 695 Bytes
/
server.js
File metadata and controls
31 lines (22 loc) · 695 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
30
31
// Clears terminal window
process.stdout.write('\033c');
// Dependencies
const express = require ("express");
const bodyParser = require ("body-parser");
const routes = require ("./routes");
var path = require('path');
// Set Port number to environmental variable -or- Port 3001
const PORT = process.env.PORT || 3001;
//Instantiate express app
const app = express();
// Middleware
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
// Routes
app.use(express.static("client/build"));
app.use(routes);
// Activate express server
app.listen(PORT, function(){
console.log(`
🍑💨 Please, pay no attention to the express app listening on port ${PORT}.`);
});