-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
35 lines (21 loc) · 842 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
33
34
35
var express = require('express');
var http = require('http');
var path = require('path');
var app = express();
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded());
app.use(bodyParser.json());
//allows to put, patch, and delete http verbs
var methodOverride = require('method-override');
app.use(methodOverride('X-HTTP-Method-Override'));
//sets up a static file server that points to the client directory
app.use(express.static(path.join(__dirname, 'client')));
var mongoose = require('./config/mongoose.js')
//set port
var port = 3000
var server = app.listen((port), function(){
console.log('Tacos be happening on port ----> ['+port+']');
});
//set optional socket connection
var io = require('socket.io')(server);
var routes = require('./config/routes.js')(app,io);