Questions and discussions about using the Shopify CLI and Shopify-built libraries.
Hello,
I'm trying to hit a backend application from my front-end in an embedded application. The backend has a database that the frontend is meant to query.
I'm building a nodejs backend with reactjs front-end.
If the frontend is trying to hit an endpoint with a GET example `/conversations`. The nodejs application always responds with a 404 Not found. I've added console.log statements to the backend and I know its processing requests.
Are requests to a nodejs backend required to have some header or something special to avoid the Not Found error?
Thank you.
Hi @akatcha
Do you use Koa? I believe Koa's default response code is 404. You need to set it explicitly:
router.get('*', verifyRequest(), async (ctx) => {
await handle(ctx.req, ctx.res);
ctx.respond = false;
ctx.res.statusCode = 200;
});