-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.js
32 lines (25 loc) · 793 Bytes
/
server.js
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
32
// server.js
'use strict'
var express = require('express'),
path = require('path'),
app = express(),
port = 8000,
bodyParser = require('body-parser');
// Make sure to include the JSX transpiler
require("node-jsx").install();
// Include static assets. Not advised for production
app.use(express.static(path.join(__dirname, 'public')));
// Set view path
app.set('views', path.join(__dirname, 'app/views'));
// set up ejs for templating. You can use whatever
app.set('view engine', 'ejs');
// Set up Routes for the application
require('./app/routes/core-routes.js')(app);
//Route not found -- Set 404
app.get('*', function(req, res) {
res.json({
"route": "Sorry this page does not exist!"
});
});
app.listen(port);
console.log('Server is Up and Running at Port : ' + port);