-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (20 loc) · 712 Bytes
/
app.js
File metadata and controls
25 lines (20 loc) · 712 Bytes
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
const express = require("express");
const path = require("path");
const app = express();
const lessMiddleware = require("less-middleware");
app.set("views", path.join(__dirname, "views"));
app.set("view engine", "pug");
app.use(lessMiddleware(path.join(__dirname, "public")));
app.use(express.static(path.join(__dirname, "public")));
app.get("/", function (req, res) {
res.render("hwchr/home", { page: "home" });
});
app.get("/about", function (req, res) {
res.render("hwchr/about", { page: "about" });
});
app.get("/projects", function (req, res) {
res.render("hwchr/projects", { page: "projects" });
});
app.listen(3000, function () {
console.log("Express listening on port 3000.");
});