This is an old revision of the document!


hosting your sketches on a local server

The steps are as follows:

  1. install nodejs and npm
  2. using npm, install http-server
  3. make a directory for your project
  4. put the necessary files in the directory
  5. run http-server from the command line in that directory
  6. use your browser to access the IP address indicated by http-server

Let's look at each step in detail.

Nodejs is available here, but you probably want to get it from your package manager instead:

https://nodejs.org/en

For Linux, check your distribution. For example, complete instructions for Arch Linux are here:

https://wiki.archlinux.org/title/Node.js

For Mac, you might use brew:

https://formulae.brew.sh/formula/node

For Windows, you could use Chocolatey:

https://community.chocolatey.org/packages/nodejs.install

NPM, the Node Package Manager, comes with your Nodejs installation. Use it to install the http-server package:

  • p5js-local-server.1708489548.txt.gz
  • Last modified: 4 months ago
  • by renick