-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
31 lines (25 loc) · 799 Bytes
/
main.go
File metadata and controls
31 lines (25 loc) · 799 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
26
27
28
29
30
31
package main
import (
"log"
"net/http"
"github.com/Gidraff/task-manager-webapp/handlers"
"github.com/Gidraff/task-manager-webapp/utils"
)
func main() {
mux := http.NewServeMux()
files := http.FileServer(http.Dir(utils.Config.Static))
mux.Handle("/static/", http.StripPrefix("/static", files))
mux.HandleFunc("/login", handlers.Login)
mux.HandleFunc("/", handlers.Index)
mux.HandleFunc("/signup", handlers.Signup)
mux.HandleFunc("/signup_account", handlers.SignUpAccount)
mux.HandleFunc("/authenticate", handlers.Authenticate)
mux.HandleFunc("/task", handlers.ReadTask)
mux.HandleFunc("/task/new", handlers.NewTask)
mux.HandleFunc("/create_task", handlers.CreateTask)
server := &http.Server{
Addr: "127.0.0.1:8080",
Handler: mux,
}
log.Fatal(server.ListenAndServe())
}