Issue summary
It is not possible to follow Next.js documentation for creating API routes in your pages/api directory. It's caused by the default setup and documentation how koa-shopify-auth is being used. As its documented right now, every single GET request to your server will be forced to authenticate, which forces any SSR request to fail, because the server is trying to verify its own API calls.
Expected behavior
The app template should support usage of Next.js API routes feature.
Actual behavior
requests to /api are being redirected to /auth.
Reduced test case
https://nextjs.org/docs#api-routes
Add the simplest of pages to pages/api/index.js that just returns 200.
Add an API call in pages/index.js using getInitialProps to that newly added /api route.
Issue summary
It is not possible to follow Next.js documentation for creating API routes in your
pages/apidirectory. It's caused by the default setup and documentation how koa-shopify-auth is being used. As its documented right now, every singleGETrequest to your server will be forced to authenticate, which forces any SSR request to fail, because the server is trying to verify its own API calls.Expected behavior
The app template should support usage of Next.js API routes feature.
Actual behavior
requests to
/apiare being redirected to/auth.Reduced test case
https://nextjs.org/docs#api-routes
Add the simplest of pages to
pages/api/index.jsthat just returns 200.Add an API call in
pages/index.jsusinggetInitialPropsto that newly added/apiroute.