mirror of
https://github.com/v1k45/pastepass.git
synced 2026-01-03 03:35:46 +00:00
20 lines
418 B
Go
20 lines
418 B
Go
package web
|
|
|
|
import (
|
|
"embed"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed static
|
|
var staticFs embed.FS
|
|
|
|
func (h *Handler) Router() http.Handler {
|
|
router := http.NewServeMux()
|
|
router.HandleFunc("GET /", h.Index)
|
|
router.HandleFunc("POST /", h.Paste)
|
|
router.HandleFunc("GET /p/{id}/{key}", h.View)
|
|
router.HandleFunc("POST /p/{id}/{key}", h.Decrypt)
|
|
router.Handle("GET /static/", http.FileServer(http.FS(staticFs)))
|
|
return router
|
|
}
|