27 lines
473 B
Go
27 lines
473 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"sprintpadawan/api"
|
|
"sprintpadawan/lib"
|
|
)
|
|
|
|
func main() {
|
|
lib.InitDB()
|
|
|
|
mux := http.NewServeMux()
|
|
|
|
// serve static assets
|
|
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
|
|
|
|
api.SetupRoutes(mux)
|
|
|
|
addr := ":8080"
|
|
log.Printf("Starting SprintPadawan server on http://localhost%s", addr)
|
|
if err := http.ListenAndServe(addr, mux); err != nil {
|
|
log.Fatalf("server error: %v", err)
|
|
}
|
|
}
|