initial commit

Signed-off-by: Pin <wf6DJd8a3xSSCZbn@protonmail.com>
This commit is contained in:
Pin
2021-01-31 16:45:18 -05:00
committed by Pin
commit 6121f39c2a
11 changed files with 214 additions and 0 deletions

20
main.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import (
"dogapi/handlers"
"log"
"net/http"
"dogapi/db"
_ "github.com/joho/godotenv/autoload"
)
func main() {
port := "8080"
err := db.ConnectDB()
if err != nil {
log.Fatalln(err)
}
log.Println("Server started on port " + port)
http.HandleFunc("/api", handlers.APIHandler)
http.ListenAndServe(":"+port, nil)
}