Source for serving and static templating/compiling of https://joshstock.in.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
54 | 04 Jan 2020 15:51 | 2d3ddfe | Move static gitpager files to new gitpager/static/ folder | Josh Stockin | 1 | 3 | 8 | N |
1 | const fs = require("fs"); |
2 | const path = require("path"); |
3 | const express = require("express"); |
4 | const app = express(); |
5 | const port = 8080; |
6 | |
7 | app.use(express.static(path.resolve(__dirname, "static"))) |
8 | let indexFile = path.resolve(__dirname, "index.html") |
9 | app.get("/", function (req, res) { |
10 | res.sendFile(indexFile); |
11 | }); |
12 | |
13 | app.listen(port); |
14 |