[英]Error: ENOENT: no such file or directory, stat '/var/task/src/functions/public/home.html'
I'm trying to deploy my express based site on.netlify and my local directory look like this:我正在尝试在.netlify 上部署我的基于 express 的站点,我的本地目录如下所示:
and my.netlify.toml looks like this: my.netlify.toml 看起来像这样:
[build]
functions="functions"
[[redirects]]
to="/.netlify/functions/_app/:splat"
from="/*"
status=200
It works fine when I run it locally using netlify dev
当我使用
netlify dev
在本地运行它时它工作正常
but when I deploy the site on.netlify it shows this error:但是当我在 .netlify 上部署网站时,它显示了这个错误:
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尝试将第 14 行:
app.use("/", router)
更改为
app.use('/.netlify/functions/_app', router); // path must route to lambda
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.