-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.txt
39 lines (34 loc) · 1.48 KB
/
test.txt
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
34
35
36
37
38
39
// r := mux.NewRouter()
// api := r.PathPrefix("/api/v1").Subrouter()
// api.HandleFunc("", get).Methods(http.MethodGet)
// api.HandleFunc("", post).Methods(http.MethodPost)
// api.HandleFunc("", put).Methods(http.MethodPut)
// api.HandleFunc("", delete).Methods(http.MethodDelete)
// api.HandleFunc("/user/{userID}/comment/{commentID}", params).Methods(http.MethodGet)
// fmt.Println("Welcome to notification service")
// log.Fatal(http.ListenAndServe(":8080", r))
// func get(w http.ResponseWriter, r *http.Request) {
// w.Header().Set("Content-Type", "application/json")
// w.WriteHeader(http.StatusOK)
// w.Write([]byte(`{ "message": "GET method called" }`))
// }
// func post(w http.ResponseWriter, r *http.Request) {
// w.Header().Set("Content-Type", "application/json")
// w.WriteHeader(http.StatusCreated)
// w.Write([]byte(`{ "message": "POST method called" }`))
// }
// func put(w http.ResponseWriter, r *http.Request) {
// w.Header().Set("Content-Type", "application/json")
// w.WriteHeader(http.StatusAccepted)
// w.Write([]byte(`{ "message": "PUT method called" }`))
// }
// func delete(w http.ResponseWriter, r *http.Request) {
// w.Header().Set("Content-Type", "application/json")
// w.WriteHeader(http.StatusOK)
// w.Write([]byte(`{ "message": "DELETE method called" }`))
// }
// func notfound(w http.ResponseWriter, r *http.Request) {
// w.Header().Set("Content-Type", "application/json")
// w.WriteHeader(http.StatusNotFound)
// w.Write([]byte(`{ "message": "Not Found" }`))
// }