I'm trying to deploy my express based site on.netlify and my local directory look like this:
and my.netlify.toml looks like this:
[build]
functions="functions"
[[redirects]]
to="/.netlify/functions/_app/:splat"
from="/*"
status=200
It works fine when I run it locally using netlify dev
but when I deploy the site on.netlify it shows this error:
I've even tried this and this approach but it isn't seem to work in my case
I'm a beginner so I'm not quite sure what mistake I'm making, so any help is greatly appreciated!
Try changing line 14: app.use("/", router)
to
app.use('/.netlify/functions/_app', router); // path must route to lambda
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.