26 lines
501 B
Go
26 lines
501 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/julienschmidt/httprouter"
|
||
|
"github.com/justinas/alice"
|
||
|
|
||
|
"replication-systems.estradiol.cloud/ui"
|
||
|
)
|
||
|
|
||
|
// routes ...
|
||
|
func (app *application) routes() http.Handler {
|
||
|
router := httprouter.New()
|
||
|
|
||
|
// setup server for static files
|
||
|
fileServer := http.FileServer(http.FS(ui.Files))
|
||
|
router.Handler(http.MethodGet, "/static/*filepath", fileServer)
|
||
|
|
||
|
router.HandlerFunc(http.MethodGet, "/", app.home)
|
||
|
|
||
|
standard := alice.New()
|
||
|
|
||
|
return standard.Then(router)
|
||
|
}
|