forked from MTSR/mapserver
parent
cd406baec5
commit
e1b255e5e5
@ -9,7 +9,7 @@
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css"/>
|
||||
<link rel="stylesheet" href="css/fontawesome.min.css"/>
|
||||
<link rel="stylesheet" href="css/leaflet.css"/>
|
||||
<link rel="stylesheet" href="css/leaflet.aewsome-markers.css"/>
|
||||
<link rel="stylesheet" href="css/leaflet.awesome-markers.css"/>
|
||||
<link rel="stylesheet" href="css/custom.css"/>
|
||||
|
||||
<title>Minetest Mapserver</title>
|
||||
@ -21,7 +21,7 @@
|
||||
<!-- libraries -->
|
||||
<script src="js/lib/mithril.min.js"></script>
|
||||
<script src="js/lib/leaflet.js"></script>
|
||||
<script src="js/lib/leaflet.aewsome-markers.js"></script>
|
||||
<script src="js/lib/leaflet.awesome-markers.js"></script>
|
||||
<script src="js/lib/moment.min.js"></script>
|
||||
|
||||
<!-- main module -->
|
||||
|
20
web/serve.go
20
web/serve.go
@ -47,7 +47,25 @@ func Serve(ctx *app.App) {
|
||||
mux.Handle("/api/mapblock/", &MapblockHandler{ctx: ctx})
|
||||
}
|
||||
|
||||
err := http.ListenAndServe(":"+strconv.Itoa(ctx.Config.Port), mux)
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
uri := r.RequestURI
|
||||
|
||||
if len(uri) >= 3 {
|
||||
suffix := uri[len(uri)-3:]
|
||||
|
||||
switch suffix {
|
||||
case "css":
|
||||
w.Header().Set("Content-Type", "text/css")
|
||||
case ".js":
|
||||
w.Header().Set("Content-Type", "application/javascript")
|
||||
case "png":
|
||||
w.Header().Set("Content-Type", "image/png")
|
||||
}
|
||||
}
|
||||
mux.ServeHTTP(w, r)
|
||||
})
|
||||
|
||||
err := http.ListenAndServe(":"+strconv.Itoa(ctx.Config.Port), nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user