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.
26 lines
501 B
26 lines
501 B
package main
|
|
|
|
import (
|
|
"context"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
"github.com/jacobmveber-01839764/BudgetBuddy/db"
|
|
"github.com/jacobmveber-01839764/BudgetBuddy/routes"
|
|
)
|
|
|
|
func main() {
|
|
|
|
r := chi.NewRouter()
|
|
|
|
// disconnect to DB on application exit
|
|
defer db.Client.Disconnect(context.Background())
|
|
|
|
r.Post("/auth/login", routes.Login)
|
|
r.Post("/auth/login/session", routes.Login)
|
|
r.Post("/auth/createaccount", routes.CreateAccount)
|
|
|
|
log.Fatal(http.ListenAndServe(":3030", r))
|
|
}
|