Remove roothandler
This commit is contained in:
parent
387d5f313b
commit
be553d6609
4
main.go
4
main.go
|
@ -174,9 +174,6 @@ func saveHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func rootHandler(w http.ResponseWriter, r *http.Request) {
|
|
||||||
io.WriteString(w, TEXT)
|
|
||||||
}
|
|
||||||
func langHandler(w http.ResponseWriter, r *http.Request) {
|
func langHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
|
@ -217,7 +214,6 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
router := mux.NewRouter().StrictSlash(true)
|
router := mux.NewRouter().StrictSlash(true)
|
||||||
router.HandleFunc("/", rootHandler)
|
|
||||||
router.HandleFunc("/p/{pasteId}", pasteHandler)
|
router.HandleFunc("/p/{pasteId}", pasteHandler)
|
||||||
router.HandleFunc("/p/{pasteId}/{lang}", langHandler)
|
router.HandleFunc("/p/{pasteId}/{lang}", langHandler)
|
||||||
router.HandleFunc("/save", saveHandler)
|
router.HandleFunc("/save", saveHandler)
|
||||||
|
|
Loading…
Reference in New Issue