-
-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathserver.js
More file actions
executable file
·30 lines (24 loc) · 776 Bytes
/
server.js
File metadata and controls
executable file
·30 lines (24 loc) · 776 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
// server.js
var express = require('express'),
path = require('path'),
app = express(),
port = 4444,
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, '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);