The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

hettlage (136) [Avatar] Offline
#1
Just a minor suggestion: It might be helpful to point out in Module 1 how to set up an http server on your computer.
Curran Kelleher (9) [Avatar] Offline
#2
That's a great thought!

We are planning on adding an "appendix" of sorts to cover this.

I'm using http-server, the NPM package found here https://www.npmjs.com/package/http-server

It can be installed with "npm install http-server -g", then you can serve the current directory with "http-server".
529486 (7) [Avatar] Offline
#3
I second that suggestion. I also would note the ES6 function implementation ( => ) -- my sense is that it's not common (yet?) to use it with d3.
529486 (7) [Avatar] Offline
#4
On the subject of the HTTP server, is there any way to set it up so you can change the directory that is being served without stopping and starting up the http server every time you switch to a different directory?
Curran Kelleher (9) [Avatar] Offline
#5
I believe you do need to stop the server, change directory, then restart it. I'm not aware of any tools that let you give them a command to change directories.

You can, however, have multiple http-server instances running at once, serving from different directories, and they will automatically use different ports.

You can also start the server from a higher level directory, and start the URL with the subpath you want to access.

Hope this helps!
529486 (7) [Avatar] Offline
#6
Thanks, that's very helpful! I was having difficulty starting the server with the higher level directory since it had an index.html file which made it difficult to access the lower level folders and subfolders. Once I removed it, I could click down the paths rather than type out the whole URL.