- Cool project! Setting up a quick local HTML server can be annoying.
Alas it looks like it's web/electron based. :/ Downloading it and yep, 443.8 MB on MacOS. The Linux one is a bit better at 183.3 MB.
Electron really should get a kickback from disk manufacturers! ;)
Shameless plug, I've been working on a HTML inspired lightweight UI toolkit because I'm convinced we can make these sort of apps and they should only be ~10-20 MB [1] with nice syntax, animation, theming, etc. I'm finally making a suite of widgets. Maybe I can make a basic clone of this! Bet I could get in < 10MB. :)
1: https://github.com/elcritch/figuro
- Because projects like these were missing back then, I got creative with nginx and do not need any config changes to serve new projects:
server {
listen 80;
server_name ~^(?<sub>\w+)(\.|-)(?<port>\d+).*; # projectx-20201-127-0-0-1.nip.io
root sites/$sub/public_html;
try_files $uri @backend;
location @backend {
proxy_pass http://127.0.0.1:$port;
access_log logs/$sub.access;
}
}
Configuration is done via the domain name like projectx-20205-127-0-0-1.nip.io which specifies the directory and port.All you need to do is create a junction (mklink /J domain folder_path). This maps the domain to a folder.
by Hyperlisk
1 subcomments
- This looks nice with a friendly UI. I've been very happy with Caddy[1], but this seems like something I might recommend to someone that is new to the web environment.
[1] https://caddyserver.com/docs/quick-starts/static-files
by nipperkinfeet
3 subcomments
- Electron? It's unfortunate how bad programming has become. Over 100MB for a program that could be written with native code under 1MB.
- https://gist.github.com/willurd/5720255
by bangaladore
2 subcomments
- Should support self-signed HTTPs ideally. IIRC there a quite a few (some?) web features that do not function unless the page is served over HTTPs.
That would certainly make this more useful than `python3 -m http.server`.
by nasso_dev
1 subcomments
- For those who have Rust, I like miniserve[1]:
cargo install --locked miniserve
miniserve path/to/directory
[1]: https://github.com/svenstaro/miniserve
by smusamashah
1 subcomments
- I use voidtools Everything on windows for instant file lookup. It has an Http server built in. Whenever browser complains about a feature only available via webserver url, not local file, it comes handy. Open everything webserver, enter name of the file and click.
- Tailscale does this, you can serve a port on your Tailnet, or you can serve a directory of files, or you can expose it to the internet. Comes with HTTPS. It's pretty neat.
https://tailscale.com/kb/1312/serve
- It looks nice and friendly, but for developers I can recommend exploring caddy[1] or nginx[2]. It's a useful technology to have worked with, even if they're ultimately only used for proxying analytics.
[1] https://caddyserver.com/
[2] https://nginx.org/
- You get a whole copy of chromium doing something a simple python -m http.server would do without the 200MB overhead
- For a second there, I read it as static web server [1], which is actually pretty cool itself
1: https://static-web-server.net/
by la_fayette
0 subcomment
- I often have the requirement, during development cycles, to bring up a static Webserver. After trying several options I always happily come back to the PHP built-in Webserver:
php -S localhost:8080
Many helpful options are available, just check the docs...
- Bun does this with;
bun index.html
https://x.com/jarredsumner/status/1886073859138580506
- npx http-server (keep the "r" at the end, it's more up-to-date than the http-serve package)
https://github.com/http-party/http-server
by Defletter
1 subcomments
- Seems like most of the people in these comments have missed the point, as while I also lament the use of Electron, pasting one-liner scripts does not obviate the usefulness of this project. Clearly the point of this project is not just about setting up a simple webserver, but to provide a quick and easy gui to configure that webserver, and there's a fair amount that it allows you to configure. Your one-liner that does nothing but pipe static files as a response is not that. If that's all you need, great, then this project is not for you and that's okay.
- 240 MB for a simple web server? You're doing something wrong. And by something, I mean everything.
by I_complete_me
2 subcomments
- My goto is https://libraries.io/pypi/beautify-http-server; upload files and everything. I have it running on my Raspberry Pi.
docker run --rm -p 8080:80 -v "$(pwd):/usr/share/nginx/html:ro" nginx:alpine
will host the current directory on 8080
- Not sure why i need this on Mac. Apache is already installed — just drop your files in ~/Sites/ or /Library/WebServer/Documents/ .
by globular-toast
0 subcomment
- Wow, this is a "full circle" moment. I can distinctly remember installing my first WAMP (Windows, Apache, MySQL, PHP) stack back in ~03 when I was learning to program. It was all easy point-and-click installers. I think I may have had to edit a config file to enable PHP, but that was it.
- Looks cool! If anyone wants a similar thing without a UI, there's a also webfsd [0]. It's mature, feature packed and fast.
[0]: https://github.com/ourway/webfsd
- If you globally install the npm module dhost, you can run it from any directory (`dhost`) to start a webserver there.
Python 2 had a similar function (`python -m SimpleHTTPServer`). I know there's a Python 3 equivalent, but I don't have it memorized.
by dark-star
3 subcomments
- cd /some/dir && python -m http.server 8080
- I basically do jwebserver.exe, done.
by theonething
0 subcomment
- python3 -m http.server 8000