DEV Community

Discussion on: [RANT] Why the hell does everything cool in JavaScript have to be locked behind needing server?

Collapse
 
foxy4096 profile image
Aditya • Edited

I just typically use python http server

python3 -m http.server

It will server the directory contents on localhost:8000

Collapse
 
baenencalin profile image
Calin Baenen

While this is a simple solution that can work for me.
Not everyone has Python installed nor wants to invest the time.

I guess it's my fault for saying I was doing testing ("I wanted to do some messing around").
But I was thinking for HTML files that could then be redistributed and run on other people's machines.

Collapse
 
besworks profile image
Besworks

You could use Cloudflare Workers to host your files for free. As with many other Web APIs, service workers are tied to a domain. When a user visits your page, your worker is installed in the browser and and acts as a kind of proxy. Future requests are then served directly from cache enabling offline access.

Thread Thread
 
baenencalin profile image
Calin Baenen

Huh. Neat.