Add support for a dev folder
This commit is contained in:
parent
3d9f9eceed
commit
8aa47b3ccb
|
@ -0,0 +1,15 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!-- Load c3.css -->
|
||||||
|
<link href="/c3.css" rel="stylesheet" type=text/css>
|
||||||
|
|
||||||
|
<!-- Load d3.js and c3.js -->
|
||||||
|
<script src="/d3.v7.min.js" charset="utf-8"></script>
|
||||||
|
<script src="/c3.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="chart"></div>
|
||||||
|
<p>Test!</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -88,11 +88,12 @@ func main() {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
http.Handle("/d/", http.StripPrefix("/d/", http.FileServer(http.Dir("./dev"))))
|
||||||
http.Handle("/", http.FileServer(http.FS(contentSub)))
|
http.Handle("/", http.FileServer(http.FS(contentSub)))
|
||||||
http.HandleFunc("/api/data/week", dumpWeek)
|
http.HandleFunc("/api/data/week", dumpWeek)
|
||||||
http.HandleFunc("/api/data/day", dumpDay)
|
http.HandleFunc("/api/data/day", dumpDay)
|
||||||
http.HandleFunc("/api/data/hour", dumpHour)
|
http.HandleFunc("/api/data/hour", dumpHour)
|
||||||
http.HandleFunc("/api/last_point", lastPoint)
|
http.HandleFunc("/api/latest", lastPoint)
|
||||||
http.HandleFunc("/api/status", getStatus)
|
http.HandleFunc("/api/status", getStatus)
|
||||||
http.HandleFunc("/api/admin", adminHandler)
|
http.HandleFunc("/api/admin", adminHandler)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue