Skip to content

Api to get all routes #1411

Discussion options

You must be logged in to vote

I think you should create an API route, or use Telefunc RPC to read your pages structure --> Transform that like you want.
If you always need that menu, inject it in the renderPage function if you using a server. Vice versa, inject it in return in onRenderHtml like

const onRenderHtml: OnRenderHtmlAsync = async (pageContext) => {
return {
    documentHtml,
    pageContext: {
      menu,
    },
  };
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by EralChen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants