From b023105b21aec381741d5e78655a836db1800796 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 30 Apr 2023 03:30:03 -0400 Subject: [PATCH] refactor: setup api versioning --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index b64fcb1..53b0c62 100644 --- a/main.go +++ b/main.go @@ -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)) })