You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
484 B

2 years ago
  1. package main
  2. import (
  3. "log"
  4. "net/http"
  5. "git.tovijaeschke.xyz/tovi/JumboPetstore/api"
  6. "git.tovijaeschke.xyz/tovi/JumboPetstore/database"
  7. "github.com/gorilla/mux"
  8. )
  9. func main() {
  10. var (
  11. router *mux.Router
  12. )
  13. log.Println("Initializing database and running AutoMigrate...")
  14. database.Init()
  15. log.Println("Initializing Petstore API...")
  16. // Initialize API endpoints
  17. router = api.InitApiEndpoints()
  18. // Start and listen to requests
  19. http.ListenAndServe(":8080", router)
  20. }