forked from squiidz/fishMe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.go
More file actions
25 lines (23 loc) · 776 Bytes
/
run.go
File metadata and controls
25 lines (23 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main
import (
"PushKids/module/handle"
"net/http"
)
func main() {
// GET Handler
http.HandleFunc("/", handle.Handler)
http.HandleFunc("/profil", handle.ProfilHandler)
http.HandleFunc("/home", handle.HomeHandler)
// POST Handler
http.HandleFunc("/signin", handle.SignIn)
http.HandleFunc("/logout", handle.LogOut)
http.HandleFunc("/add", handle.AddUser)
http.HandleFunc("/fish", handle.AddFish)
http.HandleFunc("/delete", handle.DeleteFish)
// Ressources
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("css"))))
http.Handle("/js/", http.StripPrefix("/js/", http.FileServer(http.Dir("js"))))
http.Handle("/img/", http.StripPrefix("/img/", http.FileServer(http.Dir("img"))))
// Start to serve
http.ListenAndServe(":80", nil)
}