如何“服务”子文件夹?

发布于 2025-01-17 00:18:45 字数 702 浏览 2 评论 0原文

我的 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

enter image description here

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,

enter image description here

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不甘平庸 2025-01-24 00:18:45

是的,
只需运行 serve distserve -s dist

dist 目录中打开终端并运行 serve

它也始终为所有子文件夹提供服务。

并转到 http://localhost:3000/foo/,末尾带有斜杠 /
否则,它将不会提供index.html,而只会列出目录。

Yes,
Just run serve dist or serve -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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文