refactor: setup api versioning

This commit is contained in:
Derrick Hammer 2023-04-30 03:30:03 -04:00
parent a0d747fdf4
commit b023105b21
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 2 deletions

View File

@ -46,12 +46,15 @@ func main() {
// Serve static files from the embedded directory at the app's root path
app.HandleDir("/", embedFrontend)
api := app.Party("/api")
v1 := api.Party("/v1")
// Register the AccountService with the MVC framework and attach it to the "/api/account" path
mvc.Configure(app.Party("/api/account"), func(app *mvc.Application) {
mvc.Configure(v1.Party("/account"), func(app *mvc.Application) {
app.Handle(new(service.AccountService))
})
mvc.Configure(app.Party("/api/auth"), func(app *mvc.Application) {
mvc.Configure(v1.Party("/auth"), func(app *mvc.Application) {
app.Handle(new(service.AuthService))
})