docs handling
This commit is contained in:
@@ -12,6 +12,7 @@ type Router struct {
|
||||
downloadController *DownloadController
|
||||
playController *PlayController
|
||||
rootController *RootController
|
||||
docsController *DocsController
|
||||
}
|
||||
|
||||
func NewRouter(
|
||||
@@ -20,6 +21,7 @@ func NewRouter(
|
||||
download_controller *DownloadController,
|
||||
play_controller *PlayController,
|
||||
root_controller *RootController,
|
||||
docs_controller *DocsController,
|
||||
) *Router {
|
||||
return &Router{
|
||||
softwareController: software_controller,
|
||||
@@ -27,6 +29,7 @@ func NewRouter(
|
||||
downloadController: download_controller,
|
||||
playController: play_controller,
|
||||
rootController: root_controller,
|
||||
docsController: docs_controller,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +47,7 @@ func (r *Router) Init() *chi.Mux {
|
||||
router.Get("/download/{name}/{version}/cartridge", r.downloadController.GetCartridge)
|
||||
router.Get("/play/{name}/{version}", r.playController.Play)
|
||||
router.Get("/play/{name}/{version}/content*", r.playController.ServeContent)
|
||||
router.Get("/docs/{name}/{version}/*", r.docsController.ServeDocs)
|
||||
|
||||
fs := http.FileServer(http.Dir("assets"))
|
||||
router.Handle("/assets/*", http.StripPrefix("/assets/", fs))
|
||||
|
||||
Reference in New Issue
Block a user