Skip to content

Commit f7c3f7a

Browse files
SashaMarchukclaude
andcommitted
feat(global): add public API endpoint for navigation data
Expose primaryNav, footerLinks, and socialMediaLinks via a read-only REST endpoint at GET /api/v1/@apostrophecms/global/nav. This allows the Next.js marketing app to consume navigation data without authentication. Relationship fields (_page) are automatically resolved by Apostrophe's middleware before the handler runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ebb62e0 commit f7c3f7a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • website/modules/@apostrophecms/global

website/modules/@apostrophecms/global/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,18 @@ module.exports = {
133133
},
134134
},
135135
},
136+
apiRoutes(self) {
137+
return {
138+
get: {
139+
nav(req) {
140+
const { global } = req.data;
141+
return {
142+
primaryNav: global.primaryNav || [],
143+
footerLinks: global.footerLinks || [],
144+
socialMediaLinks: global.socialMediaLinks || [],
145+
};
146+
},
147+
},
148+
};
149+
},
136150
};

0 commit comments

Comments
 (0)