-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
33 lines (31 loc) · 1.14 KB
/
main.go
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
32
33
package main
import (
"GoAPIREST/handlers"
"fmt"
"net/http"
"os"
)
func main() {
http.HandleFunc("/factures", handlers.FacturesRouter)
http.HandleFunc("/factures/", handlers.FacturesRouter)
http.HandleFunc("/services_supp", handlers.Services_suppRouter)
http.HandleFunc("/services_supp/", handlers.Services_suppRouter)
http.HandleFunc("/categories", handlers.CategoriesRouter)
http.HandleFunc("/categories/", handlers.CategoriesRouter)
http.HandleFunc("/chambres", handlers.ChambresRouter)
http.HandleFunc("/chambres/", handlers.ChambresRouter)
http.HandleFunc("/infos_hotel", handlers.Infos_hotelRouter)
http.HandleFunc("/infos_hotel/", handlers.Infos_hotelRouter)
http.HandleFunc("/fournitures", handlers.FournituresRouter)
http.HandleFunc("/fournitures/", handlers.FournituresRouter)
http.HandleFunc("/users", handlers.UsersRouter)
http.HandleFunc("/users/", handlers.UsersRouter)
http.HandleFunc("/reservations", handlers.ReservationsRouter)
http.HandleFunc("/reservations/", handlers.ReservationsRouter)
http.HandleFunc("/", handlers.RootHandler)
err := http.ListenAndServe(":11111", nil)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}