aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutumn <git@autumnfo.rest>2026-05-11 18:12:20 +0100
committerAutumn <git@autumnfo.rest>2026-05-11 18:12:20 +0100
commit377441a9a8ea65009661569177f5266704818207 (patch)
treee93cc7410c8d8634f0558b2af01227a1438dd9db
parentb1322c3da41d10b42835b1fdc5d7c12c4f8be0a7 (diff)
[pages] added basic dashboard route
-rw-r--r--src/app.ts5
-rw-r--r--src/routes/dashboard.ts17
-rw-r--r--src/views/pages/dashboard/home.pug11
-rw-r--r--tsconfig.json3
4 files changed, 35 insertions, 1 deletions
diff --git a/src/app.ts b/src/app.ts
index 876c253..bdefefa 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -11,5 +11,10 @@ const app = express()
app.set("view engine", "pug")
app.set("views", "./src/views")
+// setup routes
+import dashboardRouter from "@routes/dashboard"
+
+app.use("/", dashboardRouter)
+
// export app
export default app
diff --git a/src/routes/dashboard.ts b/src/routes/dashboard.ts
new file mode 100644
index 0000000..b617c4f
--- /dev/null
+++ b/src/routes/dashboard.ts
@@ -0,0 +1,17 @@
+//
+// ~~~ dashboard routing
+//
+
+// imports
+import { Router } from "express"
+
+// setup router
+const router = Router()
+
+// main route
+router.get("/", (_, res) => {
+ res.render("pages/dashboard/home")
+})
+
+// export router
+export default router
diff --git a/src/views/pages/dashboard/home.pug b/src/views/pages/dashboard/home.pug
new file mode 100644
index 0000000..1faf2df
--- /dev/null
+++ b/src/views/pages/dashboard/home.pug
@@ -0,0 +1,11 @@
+doctype html
+
+html
+
+ head
+
+ title Dashboard | Home Control
+
+ body
+
+ p Home Control
diff --git a/tsconfig.json b/tsconfig.json
index e912135..2e4e031 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -9,7 +9,8 @@
"types": [ "node" ],
"paths": {
- "@lib/*": [ "src/lib/*" ]
+ "@lib/*": [ "src/lib/*" ],
+ "@routes/*": [ "src/routes/*" ]
}
},