Closed abdulrahmanhenedy closed 2 months ago
Hey 👋,
What's the content of process.env.NUXT_API_BASE
? Do it send request to your Django app?
Hey 👋,
What's the content of
process.env.NUXT_API_BASE
? Do it send request to your Django app?
Nope, it's the website domain "https:// myDomain .com/"
it is an error in dev? in prod?
in the prod - it works flawlessly in dev though.
Would you be able to provide a reproduction? 🙏
Environment
Operating System: Linux Node Version: v18.19.1 Nuxt Version: 3.12.2 CLI Version: 3.12.0 Nitro Version: 2.9.6 Package Manager: yarn@1.22.22 Builder: - User Config: devtools, ssr, nitro, target, modules, vuefire, runtimeConfig, buildModules, vuetify, css, build, postcss Runtime Modules: nuxt-icon@0.4.2, @nuxt/content@2.12.0, @pinia/nuxt@0.5.1, @nuxt/image@1.7.0, nuxt-vuefire@1.0.2 Build Modules: @nuxtjs/vuetify, @nuxt/typescript-build@3.0.1
Reproduction
N/A
Describe the bug
i have a nuxt app that uses the nuxt server folder for backend besides using django as well and djaong also used for a small portion of the app. now i have a serious problem with api reqests to the nuxt server folder for some reason.
I'm getting a " [POST] (server/api file> 404 not found" everytime i try to interact (POST/GET) with the Nuxt /server/api directory, however when i turned django off i started to get "502 bad gateway" instead so it's actually quite confusing.
So after a bit of debugging i found out that the server actually looks for the api calls that supposed to go the /server folder inside Django so how could I fix that exactly?
Additional context
nuxt.config.ts
sign-in.vue (the example code where the problem happens)
server/api/signin.ts
Nginx
pm2 (ecosystem.config.js)
Logs