Correct deletion and syntax highlighing handling

This commit is contained in:
Eliot Whalan 2016-06-23 09:58:28 +10:00
parent 20fd1e7a44
commit 0af4b7ad6b
1 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ import (
const ( const (
ADDRESS = "http://localhost:9900" ADDRESS = "http://localhost:9900"
LENGTH = 6 LENGTH = 6
DELETE = ADDRESS + "/{PASTE}/{DELKEY}\n" DELETE = ADDRESS + "/del/{PASTE}/{DELKEY}\n"
PASTEARGS = ADDRESS + "/p/{PASTE}/(python|language)\n" PASTEARGS = ADDRESS + "/p/{PASTE}/(python|language)\n"
URLARGS = ADDRESS + "/save/XML|JSON\n" URLARGS = ADDRESS + "/save/XML|JSON\n"
SOURCE = "Source: https://github.com/ewhal/Pastebin\n" SOURCE = "Source: https://github.com/ewhal/Pastebin\n"
@ -221,7 +221,7 @@ func main() {
router := mux.NewRouter().StrictSlash(true) router := mux.NewRouter().StrictSlash(true)
router.HandleFunc("/", rootHandler) 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)
router.HandleFunc("/save/{output}", saveHandler) router.HandleFunc("/save/{output}", saveHandler)
router.HandleFunc("/del/{pasteId}/{delKey}", delHandler) router.HandleFunc("/del/{pasteId}/{delKey}", delHandler)