forked from shoonyatech/frontend.social
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
executable file
·33 lines (26 loc) · 838 Bytes
/
server.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
32
33
var sslRedirect = require("heroku-ssl-redirect");
var express = require("express"),
path = require("path"),
app = express();
var compress = require('compression');
app.use(sslRedirect());
app.use(compress());
require("dotenv").config();
// Serve only the static files form the dist directory
app.use(express.static(__dirname + "/dist"));
app.use(logUrl);
function logUrl(req, res, next) {
console.log(req.url);
return next();
}
app.get("/zoom", function(req, res) {
res.sendFile(path.join(__dirname + "/dist/zoom.html"));
});
app.get("/jitsi", function(req, res) {
res.sendFile(path.join(__dirname + "/dist/jitsi.html"));
});
app.get("/*", function(req, res) {
res.sendFile(path.join(__dirname + "/dist/index.html"));
});
// Start the app by listening on the default Heroku port
app.listen(process.env.PORT || 8080);