forked from sbstiane46/FriendFinder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
32 lines (22 loc) · 898 Bytes
/
server.js
File metadata and controls
32 lines (22 loc) · 898 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
31
32
var express = require("express");
var bodyParser = require("body-parser");
var app = express();
var PORT = process.env.PORT || 8080;
// application/json parse
// var jsonParser = bodyParser.json()
// application/x-www-form-urlencoded parser
app.use(bodyParser.urlencoded({ extended: true }));
// parse various different custom JSON types as JSON
app.use(bodyParser.json({ type: "application/**json"}))
// parse custom things into a Buffer
app.use(bodyParser.raw({ type: "application/vnd.custom_type" }))
// parse HTML body into a string
app.use(bodyParser.text({ type: "text/html" }))
require("./app/routing/htmlRoutes.js")(app);
// app.use(bodyParser.urlencoded({ extended: true }));
// app.use(bodyParser.json());
require("./app/routing/apiRoutes.js")(app);
require("./app/routing/htmlRoutes.js")(app);
app.listen(PORT, function() {
console.log("App listening on PORT: " + PORT);
});