diff options
| author | Patrick Schönberger | 2018-11-23 21:09:11 +0100 |
|---|---|---|
| committer | Patrick Schönberger | 2018-11-23 21:09:11 +0100 |
| commit | c2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34 (patch) | |
| tree | 14c88ba63b06055c1da70d87e351ba4e91ea5d11 /index.js | |
| download | lolstats-c2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34.tar.gz lolstats-c2916cca3182c9d0d69b0c4ffc6f5fb11e9dab34.zip | |
Initial commit
Diffstat (limited to 'index.js')
| -rw-r--r-- | index.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/index.js b/index.js new file mode 100644 index 0000000..e9169ae --- /dev/null +++ b/index.js @@ -0,0 +1,24 @@ +const mongo = require("mongodb"); +const express = require("express") +const fs = require("fs") +const mustache = require("mustache") +const app = express() +const port = 3000 + +app.get("/", (req, res) => { + fs.readFile("index.html", (err, data) => { + res.send(mustache.render("" + data, { + reload_url: process.env.BROWSER_REFRESH_URL, + })); + }); +}); + +app.get("/script.js", (req, res) => res.sendFile(__dirname + "/script.js")) + +app.listen(port, () => { + console.log("Listening on port %d", port) + console.log(process.env.BROWSER_REFRESH_URL.replace("localhost", "192.168.178.48")); + if (process.send) { + process.send("online"); + } +}); |
