Added Login and Create Account

This commit is contained in:
Gabe Farrell 2023-03-27 19:49:32 -04:00
parent 197afc4f59
commit 272e4e43b1
7 changed files with 334 additions and 0 deletions

25
main.go Normal file
View file

@ -0,0 +1,25 @@
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))
}