api 404
hello guys, i've been strugling with this for a couple of days, i have my project like this:
root
-components
--component1
--component2
-pages
--page1
--page2
-server
--api
---api1
---api2
when i run the project with "yarn dev" it works good, all api calls have a response, when i use "npm run generate" it generate the project with no errors, then when i use "npm start" it starts with no errors but all api requests gets to 404 error, i even added debug messages into my api and they are not shown in console.
using:
nuxt 3.12.4
vue: latest
node: 20.5.1
27 Replies
hey, a minimal reproduction in stackblitz or code sandbox would be nice to be able to debug the issue
will try
can i give you access to my github repo?
this thing has a lot of dependencies
if it's public yes 🙂
what's inside your
start
command?"start": "nuxt start",
no it isn't because it has api passwords
now it is public https://github.com/renobizarrox/lacsys/
GitHub
GitHub - renobizarrox/lacsys: laconic repo
laconic repo. Contribute to renobizarrox/lacsys development by creating an account on GitHub.
@manniL / TheAlexLichter sorry to summon you but can you give me a hand here?
Shouldn’t commit passwords even in private repos. Use environment variables!
yeah i'm new to this and i don't know how to do that xd
thank you
That is actually intended
Alexander Lichter
YouTube
Redirects in Nuxt 3
Redirects are essential for web applications, at least at some point when a migration has to happen or SEO should be improved by having more descriptive URLs.
#nuxt #vue
---
Links and Resources:
🔗 10% Off for vuejs.de Conf with Code LICHTER https://conf.vuejs.de/tickets/?voucher=LICHTER
🔗 Code https://github.com/manniL/alexander-lichter-nuxt...
When using SSG, you only have static files, no running server ~> no API
thank you so much mate
ok this is kind of weird...
in local i make npm run build, then npm run generate and then npm start
it works, it calls the api and the api responds no problem
on my server it doesnt
following the same steps of course