-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (25 loc) · 871 Bytes
/
index.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
31
const express = require("express");
var app = express();
var path = require('path');
var htmlPath = __dirname + "/html"
var indexPaths = ["/","/profile","/submit","/release","/setup","/recover-account","/wizard"];
app.use("/res", express.static(path.join(htmlPath + "/res")));
app.get(indexPaths, (req, res) => {
res.sendFile(path.join(htmlPath + '/index.html'));
});
app.get("/login*", (req, res) => {
res.sendFile(path.join(htmlPath + '/login.html'));
});
app.get("/auth*", (req, res) => {
res.sendFile(path.join(htmlPath + '/login-callback.html'));
});
app.get("/favicon.ico", (req, res) => {
res.sendFile(path.join(htmlPath + "/favicon.ico"))
});
//The 404 Route (Keep this as the last route)
app.get('*', function(req, res){
res.sendFile(path.join(htmlPath + '/404.html'));
});
app.listen(8082, () => {
console.log("Started listening on port 8082");
});