Proxying requests #14967
Unanswered
alex-rhodes
asked this question in
Help
Proxying requests
#14967
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I have been looking through these discussions to try and help answer this question but have been unsuccessful.
Essentially, I am building a proof of concept whereby I fetch data at build time (using
getStaticProps
) and then also fetch data on the client. This data is athttps://www.ProductionDomain.co.uk/product-api/pdp-service/partNumber/(partNumber)
. ThepartNumber
here is passed into the fetch request and not taken from the URL.I initially had this working using a custom
server.js
file, however this seemed to be an old/depreciated way of doing this. I have therefore tried with an api route, a rewrite in mynext.config.js
file as well as a rewrite inside of avercel.json
however none have been successful. These are as follows:API Route (
pages/api/product-api/pdp-service/[...slug].js
)next.config.js
vercel.json
None of the above are working, but I think I may just have something configured wrong? I was wondering if anyone could help out?
Beta Was this translation helpful? Give feedback.
All reactions