-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (20 loc) · 784 Bytes
/
Copy pathserver.js
File metadata and controls
29 lines (20 loc) · 784 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
/**
* Created by Anantha on 3/24/16.
*/
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var connectionString = mongoose.connect('mongodb://127.0.0.1:27017/test');
var db = mongoose.connection;
//var fs = require('fs');
app.use(express.static(__dirname + '/public'));
var ipaddress = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1';
var port = process.env.OPENSHIFT_NODEJS_PORT || 3000;
//app.use(bodyParser.json());
//app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
console.log("server.js running");
require("./public/server/app.js")(app,mongoose,db);
app.listen(port, ipaddress);