I’m trying to deploy my application onto Netlify, this is the domain
I have it connected to CI/CD on Git. I also have a netlify.toml file set up for the env variables, and headers for cors since my front and backend are in the same deploy.
command = “npm run build”
publish = “build”
for = “/ "”
Access-Control-Allow-Origin = "
Access-Control-Allow-Methods = “GET, POST, PUT, DELETE, OPTIONS”
Access-Control-Allow-Headers = “Authorization, Content-Type, x-ms-request-root, x-ms-request-body, x-ms-request-id”
DB_HOST = “##”
DB_USER = “##”
DB_PASSWORD = “##”
DB_DATABASE = “##”
DB_PORT = “##”
I also have the publish directory to “build” which is located in my root dir of my React app.
However with all of these checked, im still getting a
Night-In error and i cannot figure out why.
If anyone can help me out i will appreciate it.
@ish , thanks for the post.
Do you get the 404 when you navigate to a specific page, when you try to login, or when you refresh your page after visiting?
Thanks for getting back to me.
At the landing page is a simple login button where my client side function on the login button sends an axios post request to my backend folder where it holds the code to get the information from my database.
On this axios route i have it set to
https://night-in.xyz/ where my backend server recieves it at
Locally this works fine if i have my client side route to
This is the error message below:
https://night-in.xyz/ 404 (Not Found)
@ish , thanks for the feedback.
The above does not because your api route is not correct.
Kindly take a look at the forum link below to see how to properly deploy Express applications to Netlify.
I’m currently deploying my express file to netlify platform. All the tutorials are showing to use netlify-lambda package. But the package is deprecated and advised to use netlify cli. But for build command, tutorials suggesting netlify-lambda build, which is deprecated. I used normal build method like, ‘build application.js’. The sites deploys because I pointed correct folder path for fronted, but unfortunately api calls not working. It’s working with netlify-lambda build command, but as it’s de…
Also take note of the below. It has been quoted from Netlify’s Functions Documentation at
Get started with functions | Netlify Docs
These formats would deploy a synchronous function that can be called on the following endpoint:
/.netlify/functions/hello . The endpoint is relative to the base URL of your site. Here are some example full endpoint URLs:
yoursitename.netlify.app/.netlify/functions/hello for a site using the default Netlify subdomain or
www.yourcustomdomain.com/.netlify/functions/hello for a site using a custom domain