mirror of
https://github.com/gabehf/BudgetBuddy.git
synced 2026-03-09 15:38:17 -07:00
Added Login and Create Account
This commit is contained in:
parent
197afc4f59
commit
272e4e43b1
7 changed files with 334 additions and 0 deletions
25
main.go
Normal file
25
main.go
Normal 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))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue