update
This commit is contained in:
@@ -9,8 +9,8 @@ services:
|
|||||||
condition: on-failure
|
condition: on-failure
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: "0.5"
|
cpus: "0.1"
|
||||||
memory: "300m"
|
memory: "100m"
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "7010:3000"
|
- "7010:3000"
|
||||||
@@ -193,15 +193,16 @@ func Route(db *gorm.DB) {
|
|||||||
w.Write([]byte("success"))
|
w.Write([]byte("success"))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
http.HandleFunc("*", middleware.ResponseTimeMiddleware(func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
w.WriteHeader(404)
|
|
||||||
w.Write([]byte("what are you looking for!?"))
|
|
||||||
}))
|
|
||||||
|
|
||||||
http.Handle("/", middleware.ResponseTimeMiddleware(func(w http.ResponseWriter, r *http.Request) {
|
http.Handle("/", middleware.ResponseTimeMiddleware(func(w http.ResponseWriter, r *http.Request) {
|
||||||
if r.Method != http.MethodGet {
|
if r.Method != http.MethodGet {
|
||||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||||
}
|
}
|
||||||
w.Write([]byte("Welcome!"))
|
|
||||||
|
if r.URL.Path != "/" {
|
||||||
|
w.WriteHeader(404)
|
||||||
|
w.Write([]byte("What are you looking for?!"))
|
||||||
|
} else {
|
||||||
|
w.Write([]byte("Welcome!"))
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user