如何“服务”子文件夹?
我的 dist 文件夹中有不同的目录。我如何使用 vercel/serve 为他们提供服务?
localhost/foo
应该为 foo
文件夹的构建提供服务
夹的 bar
构建提供服务
localhost/bar
应该为这些子文件 文件夹是 vue(2) 构建
我可以通过 serve -s dist/foo
来服务 foo
但是是否可以 serve -s dist
all子文件夹?
它通过这种方式显示文件系统,
I have different directories in my dist folder. How can I serve them with vercel/serve?
localhost/foo
should serve the build of foo
folder
localhost/bar
should serve the build of bar
folder
these sub folders are vue(2) builds
I can serve foo
by serve -s dist/foo
But is it possible to serve -s dist
all subfolders?
It shows file system by this way,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,
只需运行
serve dist
或serve -s dist
或
在 dist 目录中打开终端并运行
serve
它也始终为所有子文件夹提供服务。
并转到 http://localhost:3000/foo/,末尾带有斜杠 /
否则,它将不会提供index.html,而只会列出目录。
Yes,
Just run
serve dist
orserve -s dist
OR
open terminal in dist directory and run
serve
It always serve all subfolders as well.
And go to http://localhost:3000/foo/, with trailing slash /
Otherwise it will not serve index.html and just list directory.