forked from asaratik/boffee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
30 lines (23 loc) · 815 Bytes
/
app.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
var http = require("http");
var url = require('url');
var fs = require('fs');
var path = require('path');
var express = require("express");
var bodyParser = require("body-parser");
var request = require('request');
var app = express();
var mongojs = require('mongojs');
app.set('port', process.env.PORT || 3040);
// static content
app.use(express.static(path.join(__dirname, 'static')));
app.set('views',path.join(__dirname,'static/views'));
app.set('view engine','ejs');
app.use(bodyParser.urlencoded({limit: '50mb', extended: false}));
app.use(bodyParser.json({limit: '50mb'}));
var server = http.createServer(app);
// Require Router
require('./config/routes.js')(app);
// Start Application
server.listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});