Open sudo-barun opened 3 months ago
https://github.com/vercel/serve
bunx serve
@zoto-ff serve
is not a built-in feature. It is a npm package. bun has to download serve
(if not downloaded already) before bunx serve
works.
+1 for this
Right now I'm using
bun install --global http-server
http-server
Given that Bun has its own built-in web server, it would make sense to expose it as a command, so that you could serve static files without a third-party solution.
Similarly to the http-server
command, I think bun serve
without arguments should be enough to serve static files from the current directory.
What is the problem this feature would solve?
Bun does not have built-in web server that can be run through CLI.
While there are many package in NPM to create web server, it is a hassle to decide on which package to install, especially for beginners.
Other programming language runtimes provide option in CLI to run web server:
python3 -m http.server
php -S localhost:8000
What is the feature you are proposing to solve the problem?
It would be great if Bun provides built-in web server that can be run through CLI.
What alternatives have you considered?
Although Deno does not have built web server, it does provide standard package to run web server:
Bun can also provide such standard package.
But, I still prefer having option in bun CLI instead of introducing one extra executable.