-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (20 loc) · 786 Bytes
/
app.js
File metadata and controls
25 lines (20 loc) · 786 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
const express = require("express");
const app = express();
const bodyparser = require("body-parser");
const path = require("path");
const port = process.env.PORT || 5000;
const watsonAPI = require("./routes/api/watson/auth");
const googleAPI = require("./routes/api/google/auth");
const stackoverflowAPI = require("./routes/api/stackoverflow/auth");
app.use(require("cors")());
app.use(express.static(__dirname + "/public"));
app.use(bodyparser.urlencoded({ extended: true }));
app.use("/watson", watsonAPI);
app.use("/google", googleAPI);
app.use("/stackoverflow", stackoverflowAPI);
app.get("/", (req, res) => {
// res.sendFile("index.html");
// console.log("Sent");
res.sendFile("index.html");
});
app.listen(port, () => console.log(`App is running at port ${port}...`));