Add index page

This commit is contained in:
Eliot Whalan 2016-06-23 11:06:52 +10:00
parent b05d6917eb
commit 9361b3f64d
No known key found for this signature in database
GPG Key ID: C0A42175139840D6
2 changed files with 13 additions and 0 deletions

View File

@ -214,6 +214,7 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) {
func main() {
router := mux.NewRouter().StrictSlash(true)
router.PathPrefix("/").Handler(http.StripPrefix("/", http.FileServer(http.Dir("static/"))))
router.HandleFunc("/p/{pasteId}", pasteHandler)
router.HandleFunc("/p/{pasteId}/{lang}", langHandler)
router.HandleFunc("/save", saveHandler)

12
static/index.html Normal file
View File

@ -0,0 +1,12 @@
<html>
<head>
<title></title>
</head>
<body>
<form action="https://p.pantsu.cat/save" method="post">
<input type="text" name="p">
<input type="submit" value="paste">
</form>
</body>
</html>