summaryrefslogtreecommitdiff
path: root/router
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-12-24 17:17:15 +0530
committerBobby <[email protected]>2025-12-24 17:17:15 +0530
commitd5ea2aa824eee4b7e2d169d21da0107d057e7bc6 (patch)
treee608fea8cf91d6915b7b6ce5eb46896dbdc2ad79 /router
parentb77d75f05fb2059389c05f6c01484e0cd12e796e (diff)
downloadlain-d5ea2aa824eee4b7e2d169d21da0107d057e7bc6.tar.xz
lain-d5ea2aa824eee4b7e2d169d21da0107d057e7bc6.zip
feat: Implement API endpoints for email details and actions, and refactor email preview for client-side rendering with Shadow DOM.
Diffstat (limited to 'router')
-rw-r--r--router/api.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/router/api.go b/router/api.go
new file mode 100644
index 0000000..ce7b5bf
--- /dev/null
+++ b/router/api.go
@@ -0,0 +1,16 @@
+package router
+
+import (
+ "lain/controllers"
+ "lain/types"
+ "lain/utils/auth"
+ "lain/utils/urls"
+)
+
+func init() {
+ urls.SetNamespace("api")
+
+ urls.Path(types.GET, "/mail/email/:id", auth.RequireAuthentication(controllers.GetEmailAPI), "get_email")
+ urls.Path(types.POST, "/mail/email/:id/flag", auth.RequireAuthentication(controllers.ToggleFlagAPI), "toggle_flag")
+ urls.Path(types.POST, "/mail/email/:id/read", auth.RequireAuthentication(controllers.MarkEmailAsReadAPI), "mark_read")
+}