aboutsummaryrefslogtreecommitdiff
path: root/src/routes/dashboard.ts
blob: a4cf20a805c62a742f7593b17940b03b67e30f44 (plain)
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
26
27
28
29
30
31
32
33
//
// ~~~ dashboard routing
//

// imports
import { Router } from "express"
import allDevices from "@lib/config/devices.ts"
import allActions from "@lib/config/actions.ts"

// setup router
const router = Router()

// main route
router.get("/", (_, res) => {
    res.render("pages/dashboard/home")
})

// all devices
router.get("/devices", (_, res) => {
    res.render("pages/dashboard/devices", {
        devices: allDevices
    })
})

// all actions
router.get("/actions", (_, res) => {
    res.render("pages/dashboard/actions", {
        actions: allActions
    })
})

// export router
export default router