initial commit
Signed-off-by: Pin <Pin>
This commit is contained in:
21
main.go
Normal file
21
main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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.Println("asd")
|
||||
log.Fatalln(err)
|
||||
}
|
||||
log.Println("Server started on port " + port)
|
||||
http.HandleFunc("/api", handlers.APIHandler)
|
||||
http.ListenAndServe(":"+port, nil)
|
||||
}
|
||||
Reference in New Issue
Block a user