from Hacker News

Show HN: Running a simple local HTTP server in a web page

by etherdream on 10/30/21, 9:12 AM with 17 comments

  • by fregante on 10/31/21, 8:04 AM

    For those who don’t understand what it’s doing (like me at first):

    You first have to host these index.html and sw.js on a regular server (or use the URL in the readme) and then this service will serve a folder of your choice directly from your computer.

    This is if you ran your trusty Python server from the CLI, except you did it from the browser, with an unchangeable host:port

    The folder will appear to be published from the server that hosts that sw.js file.

  • by beardyw on 10/30/21, 10:28 AM

    I may be missing the point, but HTTP is a communication protocol. This looks like a file explorer and editor.
  • by stagas on 10/31/21, 10:34 AM

    Genius! I feel the File System Access API[0] has a lot of potential in bringing data ownership back to the users (instead of being held by some server) but it's very under-utilized atm.

    Nice work.

    [0]: https://developer.mozilla.org/en-US/docs/Web/API/File_System...

  • by la_fayette on 10/31/21, 3:42 PM

    From the title, I thought it would be a web server compiled as web assembly and running in the browser...
  • by e-clinton on 10/30/21, 1:55 PM

    This is interesting. It’d be cool to drop in a wysiwyg editor. Could be a fun way to learn basic web dev
  • by Tepix on 10/31/21, 8:07 AM

    Where is the source code for the .webm file?