leanwebclub/structure-and-scale/main.go

33 lines
2.1 KiB
Go

package main
import (
"net/http"
"log"
)
func main() {
mux := http.NewServeMux()
mux.Handle("GET /dice-library/", http.StripPrefix("/dice-library", http.FileServer(http.Dir("dice-library"))))
mux.Handle("GET /dice-library-es-modules/", http.StripPrefix("/dice-library-es-modules", http.FileServer(http.Dir("dice-library-es-modules"))))
mux.Handle("GET /treasure-chest/", http.StripPrefix("/treasure-chest", http.FileServer(http.Dir("treasure-chest"))))
mux.Handle("GET /treasure-chest-chaining-static/", http.StripPrefix("/treasure-chest-chaining-static", http.FileServer(http.Dir("treasure-chest-chaining-static"))))
mux.Handle("GET /treasure-chest-user-options/", http.StripPrefix("/treasure-chest-user-options", http.FileServer(http.Dir("treasure-chest-user-options"))))
mux.Handle("GET /treasure-chest-js-class/", http.StripPrefix("/treasure-chest-js-class", http.FileServer(http.Dir("treasure-chest-js-class"))))
mux.Handle("GET /treasure-chest-private/", http.StripPrefix("/treasure-chest-private", http.FileServer(http.Dir("treasure-chest-private"))))
mux.Handle("GET /treasure-chest-custom-events/", http.StripPrefix("/treasure-chest-custom-events", http.FileServer(http.Dir("treasure-chest-custom-events"))))
mux.Handle("GET /dice-component/", http.StripPrefix("/dice-component", http.FileServer(http.Dir("dice-component"))))
mux.Handle("GET /dice-component-interactivity/", http.StripPrefix("/dice-component-interactivity", http.FileServer(http.Dir("dice-component-interactivity"))))
mux.Handle("GET /seven-seas/", http.StripPrefix("/seven-seas", http.FileServer(http.Dir("seven-seas"))))
mux.Handle("GET /seven-seas-bundlers/", http.StripPrefix("/seven-seas-bundlers", http.FileServer(http.Dir("seven-seas-bundlers"))))
mux.Handle("GET /seven-seas-page-specific-bundles/", http.StripPrefix("/seven-seas-page-specific-bundles", http.FileServer(http.Dir("seven-seas-page-specific-bundles"))))
mux.Handle("GET /seven-seas-service-worker/", http.StripPrefix("/seven-seas-service-worker", http.FileServer(http.Dir("seven-seas-service-worker"))))
log.Println("Start the web server...")
err := http.ListenAndServe(":8080", mux)
if err != nil {
panic(err)
}
}