-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
27 lines (22 loc) · 805 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
var express= require("express"),
app = express(),
bodyParser= require("body-parser"),
mongoose=require("mongoose"),
fileUpload= require("express-fileupload"),
methodOverride= require("method-override");
// Employee Routes
var employeeRoutes=require("./routes/employees");
// Connecting to the MongoDB database
mongoose.connect("mongodb://localhost/apiria");
mongoose.Promise= global.Promise;
app.set("view engine", "ejs");
app.use(bodyParser.urlencoded({extended:true}));
app.use(bodyParser.json());
app.use(express.static(__dirname+"/public"));
app.use(methodOverride("_method"));
app.use(fileUpload());
// using the Employee routes in app.js
app.use("/upload", employeeRoutes);
app.listen(process.env.PORT, process.env.IP, function(){
console.log("Process Started!!");
});