-
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 Are the api lamdas running when the |
Beta Was this translation helpful? Give feedback.
Answered by
paulogdm
Mar 22, 2020
Replies: 1 comment
-
Yes it is, but you may need to do:
You need to access the "host" header in order to retrieve the information from where your request is coming from. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
coetry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes it is, but you may need to do:
You need to access the "host" header in order to retrieve the information from where your request is coming from.