How to fix route api 404 error in shopify app remix?

Hello,

How to fix 404 error?
This is my project structure and code.

I don`t know how to solve this problems.

I am working in development store

When click button, got 404 error

Please give me advice
Thank you

Hi @YasunariKimura

Have you tried executing ‘npm run deploy’ before? For newly added routes, it is necessary to execute ‘npm run deploy’.

Thank you for your reply.

I fixed this problems.

YasunariKimura_0-1733395264090.png

I changed route folder name so solved 404 error.
but I don`t know this method is not correct in rule.

Thank you.

I understand what you mean. You can refer to these two remix documents, which provide explanations for these two routing methods.

https://remix.run/docs/en/main/file-conventions/routes

https://remix.run/docs/en/main/discussion/routes