|
@@ -10,7 +10,7 @@ import (
|
10
|
10
|
req "./core/request"
|
11
|
11
|
res "./core/response"
|
12
|
12
|
"./routes"
|
13
|
|
- errorHandler "./src/lib/error"
|
|
13
|
+ "./src/lib/errors"
|
14
|
14
|
)
|
15
|
15
|
|
16
|
16
|
func main() {
|
|
@@ -25,14 +25,13 @@ func main() {
|
25
|
25
|
database.Init(dbConfig)
|
26
|
26
|
|
27
|
27
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
28
|
|
- var Errors errorHandler.Errors
|
29
|
28
|
|
30
|
29
|
res.SetResponseWriter(w)
|
31
|
30
|
req.SetRequest(r)
|
32
|
31
|
|
33
|
32
|
if !database.IsConnected {
|
34
|
|
- Errors.InternalError("Conexão com a base de dados falhou!")
|
35
|
|
- res.JSON(Errors)
|
|
33
|
+ errors.InternalError("Conexão com a base de dados falhou!")
|
|
34
|
+ res.JSON(errors)
|
36
|
35
|
return
|
37
|
36
|
}
|
38
|
37
|
|