website/src/index.ts

24 lines
409 B
TypeScript
Raw Normal View History

2024-06-09 07:22:05 +00:00
import express from "express";
import nunjucks from "nunjucks";
2024-07-05 13:22:31 +00:00
import app from "./app.js";
2024-06-09 07:22:05 +00:00
const site = express();
2024-08-30 06:56:53 +00:00
const maxAge = 1000 * 60 * 60 * 24 * 7;
2024-07-03 07:47:47 +00:00
nunjucks.configure("templates", {
2024-06-09 07:22:05 +00:00
autoescape: true,
express: site,
});
2024-08-30 06:56:53 +00:00
site.use(
express.static(".", {
maxAge: maxAge,
immutable: true,
})
);
2024-06-09 07:22:05 +00:00
site.get("/", app.index);
site.listen(8080, () => console.log("app listening on 8080"));