mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-12 21:35:40 +08:00
Add a home page (#113)
This commit is contained in:
21
serve.go
21
serve.go
@@ -51,6 +51,24 @@ import (
|
||||
"github.com/micromdm/micromdm/queue"
|
||||
)
|
||||
|
||||
const homePage = `<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>MicroMDM</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Welcome to MicroMDM!</h3>
|
||||
<p><a href="mdm/enroll">Enroll a device</a></p>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
|
||||
const configDBPath = "/var/db/micromdm"
|
||||
|
||||
func serve(args []string) error {
|
||||
@@ -167,6 +185,9 @@ func serve(args []string) error {
|
||||
r.Handle("/scep", scepHandler)
|
||||
r.Handle("/push/{udid}", pushHandlers.PushHandler)
|
||||
r.Handle("/v1/commands", commandHandlers.NewCommandHandler).Methods("POST")
|
||||
r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
io.WriteString(w, homePage)
|
||||
})
|
||||
|
||||
if *flRepoPath != "" {
|
||||
r.PathPrefix("/repo/").Handler(http.StripPrefix("/repo/", http.FileServer(http.Dir(*flRepoPath))))
|
||||
|
||||
Reference in New Issue
Block a user