mirror of
https://api.glitch.com/git/presence-button
synced 2024-11-16 17:17:29 +00:00
752427dec7
./package.json:933874/347 ./server.js:933874/577 ./views/index.html:933874/979
24 lines
805 B
JavaScript
24 lines
805 B
JavaScript
const express = require("express");
|
|
const app = express();
|
|
|
|
// http://expressjs.com/en/starter/static-files.html
|
|
app.use(express.static("public"));
|
|
|
|
// http://expressjs.com/en/starter/basic-routing.html
|
|
app.get("/", function(request, response) {
|
|
response.sendFile(__dirname + "/views/index.html");
|
|
});
|
|
|
|
// http://expressjs.com/en/starter/basic-routing.html
|
|
app.get("/img", function(request, response) {
|
|
response.sendFile(__dirname + "/views/index.html");
|
|
});
|
|
|
|
const listener = app.listen(process.env.PORT, function() {
|
|
console.log("Your app is listening on port " + listener.address().port);
|
|
});
|
|
|
|
process.on("SIGTERM", function () {
|
|
console.log("SIGTERM received, sending SOS to Resurrect...");
|
|
require('https').get("https://resurrect.glitch.me/"+process.env.PROJECT_DOMAIN+"", process.exit)
|
|
}); |