I build my react/node project. If I choose my dist directory as publish directory while deploying, it doesnt call the functions on front end. If I don't choose directory for publish, I see 404 error of netlify. Any solution for that?
Great tutorial... By the way I have a question, is that route prefix "/.netlify/functions/" a must? PS: Found that it can be solved by adding a redirect rule to netlify.toml like this [[redirects]] force = true from = "/api/*" status = 200 to = "/.netlify/functions/api/:splat"
@@thedevcorners My men! It ended working!! Two things: my gratitude to you for you willing to help. With that I was going to make a good explanation to get help by you and, in the process, I fix it. Now I was trying to make a good explanation on why it was break and I get with this: ▬ If you use a template string plus some variables, it would not work. I had something like this « const ROUTES = { MOVIES: `movies`, HOME: `/` } app.get(`/.netlify/functions/app/${ROUTES.MOVIES}/:id`, fn) » That's going to throw an error. This is how I fix that: « const PREFIX_ROUTES = "/.netlify/functions/app" const ROUTES = { MOVIES: `${PREFIX_ROUTES}/movies`, HOME: `${PREFIX_ROUTES}/` } app.get(ROUTES.HOME, fn) app.get(`${ROUTES.MOVIES}`, fn) app.get(`${ROUTES.MOVIES}/:id`, fn) » Thanks for all =)!
@@thedevcorners I though I made a reply but it was not the case. The problem was the use of template strings, I had something like this: `/.netlify/functions/app/${ROUTES.MOVIES}/:id`. That doesn't work for I don't know which reason. But if I extract the prefix into other variable it ended working. Like this: «const ROUTES_PREFIX = "/.netlify/functions/app"; const ROUTES = {MOVIES: `${ROUTES_PREFIX}/movies`}; app.get(`${ROUTES.MOVIES}/:id`, fn)». So, thanks so much for your willing to help ♥
very nice. My routes are in /Routes/courseRoutes.js file so how can i access them?
netlify-lamda has already been deprecated. How to do it without netlity-lamda ?
I build my react/node project. If I choose my dist directory as publish directory while deploying, it doesnt call the functions on front end. If I don't choose directory for publish, I see 404 error of netlify. Any solution for that?
Did u find any solution?
Great tutorial... By the way I have a question, is that route prefix "/.netlify/functions/" a must?
PS: Found that it can be solved by adding a redirect rule to netlify.toml like this
[[redirects]]
force = true
from = "/api/*"
status = 200
to = "/.netlify/functions/api/:splat"
Yes, it's a must! Thanks for the addition!
@@thedevcorners np.. seems above rule can only be used with express apps.
@@thedevcorners Is there a way to deploy from github?
wow thanks bro
I have actually already made the project in github so can you help me with that
Glad to hear that! have you followed the instruction in the video?
@@thedevcorners I already have made the repo and project before
Next time maybe don't Screencast a such a huge screensize...😅
the video is great just zoom in a little
Appreciate for the input!
It doesnt' work for me but thanks!
Can you give the details why it didn't work?
@@thedevcorners My men! It ended working!! Two things: my gratitude to you for you willing to help. With that I was going to make a good explanation to get help by you and, in the process, I fix it.
Now I was trying to make a good explanation on why it was break and I get with this:
▬ If you use a template string plus some variables, it would not work. I had something like this
«
const ROUTES = {
MOVIES: `movies`,
HOME: `/`
}
app.get(`/.netlify/functions/app/${ROUTES.MOVIES}/:id`, fn)
»
That's going to throw an error. This is how I fix that:
«
const PREFIX_ROUTES = "/.netlify/functions/app"
const ROUTES = {
MOVIES: `${PREFIX_ROUTES}/movies`,
HOME: `${PREFIX_ROUTES}/`
}
app.get(ROUTES.HOME, fn)
app.get(`${ROUTES.MOVIES}`, fn)
app.get(`${ROUTES.MOVIES}/:id`, fn)
»
Thanks for all =)!
@@thedevcorners I though I made a reply but it was not the case.
The problem was the use of template strings, I had something like this: `/.netlify/functions/app/${ROUTES.MOVIES}/:id`. That doesn't work for I don't know which reason. But if I extract the prefix into other variable it ended working. Like this: «const ROUTES_PREFIX = "/.netlify/functions/app"; const ROUTES = {MOVIES: `${ROUTES_PREFIX}/movies`}; app.get(`${ROUTES.MOVIES}/:id`, fn)».
So, thanks so much for your willing to help ♥
Pls make your fonts bigger for God sake.
Good Tutoriall but too annoying to see the code.
1. Just zoom In the editor,
2. Add a soft bg music.
Appreciate it man!
It does not work. waste of time
Thank you :) at least it works for me.