SSG: Consume internal API routes inside getStaticProps #11179
-
Is it possible the consume an internal api of a Next.js project (e.g.: Example: export async function getStaticProps(context) {
// The following url must be absolute
// but what is the correct origin/port?
const url = '/api/post'
return {
props: await fetch(url).then(res => res.json())
}
} Before (in |
Beta Was this translation helpful? Give feedback.
Answered by
timneutkens
Mar 19, 2020
Replies: 1 comment
-
See #9524 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
HaNdTriX
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See #9524 (comment)