webaudio-examples icon indicating copy to clipboard operation
webaudio-examples copied to clipboard

Added npm tooling to serve files with livereload

Open fijiwebdesign opened this issue 3 years ago • 3 comments

Added tooling to start a http server with live-reload built in

npm install
npm start

fijiwebdesign avatar Aug 07 '21 06:08 fijiwebdesign

This repo has educational purposes. As far as I understand, you are suggesting the student to install npm, add 4 dependencies (one of them being Express) and run a local server only so that the student doesn't have to hit F5. IMO that doesn't help learning. It might even make things unnecessarily confusing for the beginner.

Leokuma avatar Aug 09 '21 16:08 Leokuma

This repo has educational purposes. As far as I understand, you are suggesting the student to install npm, add 4 dependencies (one of them being Express) and run a local server only so that the student doesn't have to hit F5. IMO that doesn't help learning. It might even make things unnecessarily confusing for the beginner.

The tooling is purely optional of course. It does provide an easy way to serve the examples and help the developers that extend the codebase.

fijiwebdesign avatar Aug 10 '21 14:08 fijiwebdesign

I myself use VSCode with the Live Server v5.7.9 from Ritwick Dey. WebStorm has similar feature. Even python3 -m http.server could do the jobs (apart for WebASM iirc)

So I don't need this option to have out of the box config available for a server.

clemens-tolboom avatar Sep 22 '22 17:09 clemens-tolboom

I agree with the others in here about leaving the tooling out of this repo, but what we can offer is some documentation that shows how to serve directory contents in a generic way.

Can we improve the README with build instructions, maybe? I'm personally using http-server so it looks like

npm install -g http-server
cd example-dir
http-server

The python example above is also great. What do you think?

bsmth avatar Nov 02 '22 14:11 bsmth

What @bsmth said - though I would link to https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server#running_a_simple_local_http_server

hamishwillee avatar Nov 02 '22 21:11 hamishwillee

There is also an extension to VSCode (vscode-preview-server) that allows launching a local website in one click. (It is based on the free and open browsersync.io tool).

teoli2003 avatar Nov 03 '22 06:11 teoli2003

@teoli2003 That's cool - I wonder if it is worth adding to https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server#running_a_simple_local_http_server as well?

hamishwillee avatar Nov 03 '22 23:11 hamishwillee

Almost a discussion... but pinging @schalkneethling - do you think it's worth adding a note to the 'demo' repos readmes (once we've rolled out the template files) with a couple of options to serve locally?

Rumyra avatar Nov 04 '22 09:11 Rumyra

Hi @fijiwebdesign thanks a lot for suggesting the changes - I think there's a preference to give some documentation hints instead of adding tooling, so I'm closing this in favor of https://github.com/mdn/webaudio-examples/pull/110

If you have some feedback or suggestions, please feel free to leave it on the other pull request. Thank you :)

bsmth avatar Jun 29 '23 15:06 bsmth