本文中的教程作品:
但是,服务器输入点必须在 api/index中。 JS
如下所示:
# create the `api` folder, and the server entry point
mkdir api
touch api/index.js
...和在 vercel.json
中:
{
"rewrites": [{ "source": "/(.*)", "destination": "/api" }]
}
但是,如果我尝试将 index.js
移动到任何其他目录,则Vercel将根本不执行JavaScript,而只需在浏览器中显示RAW JAVASCRIPT即可。
您如何移动服务器入口点并仍然告诉Vercel正确执行它?
另外,我尝试直接联系文章作者(StéphaneP。péricat),但我无法在任何地方找到他的联系信息(只有Github,Twitter,Mediver等)
The tutorial in this article works:
https://medium.com/@sppericat/how-to-setup-an-apollo-graphql-server-on-vercel-cc3f2dd72b3e
However, the server entry point must be in api/index.js
as shown here:
# create the `api` folder, and the server entry point
mkdir api
touch api/index.js
...and in vercel.json
:
{
"rewrites": [{ "source": "/(.*)", "destination": "/api" }]
}
However, if I try to move index.js
to any other directory, then Vercel will not execute the Javascript at all and just show the raw Javascript in the browser.
How do you move the server entry point and still tell Vercel to execute it properly?
Also, I've tried to contact the article author (Stéphane P. Péricat) directly, but I'm unable to find his contact info anywhere (just profiles like Github, Twitter, Medium, etc.)
发布评论