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

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

YasunariKimura
Shopify Partner
2 0 0

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

YasunariKimura_0-1733302063540.pngYasunariKimura_1-1733302086272.png

  

YasunariKimura_2-1733302135568.png

When click button, got 404 error

YasunariKimura_3-1733302281828.png

 

 

Please give me advice
Thank you

Replies 3 (3)

Kyle_liu
Shopify Partner
368 47 62

Hi @YasunariKimura 

 

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

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee
YasunariKimura
Shopify Partner
2 0 0

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.
 

Kyle_liu
Shopify Partner
368 47 62

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 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee