save
This commit is contained in:
29
internal/app/routes.go
Normal file
29
internal/app/routes.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"lash"
|
||||
"lash/internal/errx"
|
||||
"lash/internal/handlers"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func New() http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
fp, err := GetFilePath()
|
||||
if err != nil {
|
||||
errx.FatalPerror(err)
|
||||
}
|
||||
|
||||
share := handlers.ShareData{
|
||||
Version: lash.Version,
|
||||
FileName: fp,
|
||||
}
|
||||
|
||||
file := handlers.FileData{}
|
||||
|
||||
mux.HandleFunc("/", share.Handler)
|
||||
mux.HandleFunc("/api/receive-token", file.APIHandler)
|
||||
|
||||
return mux
|
||||
}
|
||||
Reference in New Issue
Block a user