pre-dev: initial commit

This commit is contained in:
2025-08-11 10:25:54 +07:00
parent e0ecf1c906
commit ee9b4a9035
50 changed files with 1020 additions and 1 deletions
@@ -0,0 +1,23 @@
package home
import (
"encoding/json"
"net/http"
)
func Home(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
jsonText, _ := json.Marshal(map[string]string{"message": "Resource can not be found!!"})
w.WriteHeader(http.StatusNotFound)
w.Write(jsonText)
return
}
jsonText, _ := json.Marshal(map[string]string{"message": "Welcome to the API"})
w.Write(jsonText)
}
func TempResponse(w http.ResponseWriter, r *http.Request) {
jsonText, _ := json.Marshal(map[string]string{"message": "Nice move by the programmer, now tell him that he forgot this part"})
w.Write(jsonText)
}