无服务器函数渲染代码而不是执行

发布于 2025-02-10 15:46:33 字数 330 浏览 0 评论 0原文

因此,我今天试图托管无服务器功能。 首先,我尝试了vercel,/api/index.js 它在DEV中工作正常,但是一旦我部署了它,就开始发送代码以响应,而不是执行文件并按照其中的规定发送响应。

因此,现在我正在尝试Netlify,但这里也没有运气。 态 响应

So I was trying to host a serverless function today.
First I tried Vercel, /api/index.js
And it was working fine in dev but as soon as I deployed it it started sending the code in response instead of executing the file and sending response as stated in it.

So now I'm trying Netlify but no luck here either.
/functions/tweet.js
the response

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文