summaryrefslogtreecommitdiff
path: root/nexus/router/api.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-29 22:52:46 +0530
committerBobby <[email protected]>2026-03-29 22:52:46 +0530
commit9eb9b7f4bd552a641235764f66483e1f940fcfd9 (patch)
treeda520b923b5e6758d5457b6233dd6671fc640914 /nexus/router/api.go
parent65a143a0871c35989b7c7ea6723d39a0585c089e (diff)
downloadechoes-of-vaelun-main.tar.xz
echoes-of-vaelun-main.zip
feat: nexus account manager scaffold with auth, characters, realmsHEADmain
Diffstat (limited to 'nexus/router/api.go')
-rw-r--r--nexus/router/api.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/nexus/router/api.go b/nexus/router/api.go
new file mode 100644
index 0000000..6f8314e
--- /dev/null
+++ b/nexus/router/api.go
@@ -0,0 +1,29 @@
+package router
+
+import (
+ "nexus/api/account"
+ "nexus/api/auth"
+ "nexus/api/characters"
+ "nexus/api/realms"
+ nexusAuth "nexus/utils/auth"
+ "nexus/utils/urls"
+)
+
+func init() {
+ urls.SetNamespace("api")
+
+ urls.Path(urls.Post, "/auth/register", auth.Register, "auth.register")
+ urls.Path(urls.Post, "/auth/login", auth.Login, "auth.login")
+ urls.Path(urls.Post, "/auth/refresh", auth.Refresh, "auth.refresh")
+ urls.Path(urls.Post, "/auth/logout", nexusAuth.APIAuth(auth.Logout), "auth.logout")
+
+ urls.Path(urls.Get, "/account", nexusAuth.APIAuth(account.Show), "account.show")
+ urls.Path(urls.Delete, "/account", nexusAuth.APIAuth(account.Delete), "account.delete")
+
+ urls.Path(urls.Get, "/characters", nexusAuth.APIAuth(characters.Index), "characters.index")
+ urls.Path(urls.Get, "/characters/:id", nexusAuth.APIAuth(characters.Show), "characters.show")
+ urls.Path(urls.Post, "/characters", nexusAuth.APIAuth(characters.Create), "characters.create")
+ urls.Path(urls.Delete, "/characters/:id", nexusAuth.APIAuth(characters.Delete), "characters.delete")
+
+ urls.Path(urls.Get, "/realms", nexusAuth.APIAuth(realms.Index), "realms.index")
+}