Website name: glittery-gelato-aa8769
I have deployed my Vite + Vue3 BitBucket project to Netlify but I am having a problem making an API call.
Instead of sending a request to my api (e.g. foo.bar/api/) It’s sending it through Netlify (e.g. glittery-gelato-aa8769.netlify.com/api/).
I have tried creating a _redirect file with no luck and I don’t seem to have a netlify.toml file anywhere within the repo. I am getting a 404 response with the URL going to Netlify instead of my API. This works perfectly fine on localhost with my Vite config file handling the proxy.
How can I make it so this doesn’t happen? Thank you.
What is the contents of the
_redirects file, and where is it in the repository? Does it look something like
/api https://api.example.com 200
This file needs to reside in the publish directory for Netlify to dectect and process it.
If you prefer to use a
netlify.toml, create one at the root of the repository. See
The contents of the file are:
/api https://nonlinear.devcentre.nz 200
It is in the root folder of my BitBucket project. App.vue is hosted in ./src
I am using yarn build in Netlify.
As I mentioned, and as stated in the documentation, the
_redirects file needs to go into the publish directory. If you are using a Vue project, put it in the
public directory so it is copied to the publish directory during build.