Sketches made with processing
This project provides a server to run and share works created that use the p5.js library.
- Open the command line, us
lsto find out where you are, use
cdto change to the right folder
- Repeat until found the correct folder you download this project into.
npm run startto host the server on your computer
- Go to http://localhost:3000/ and see the work.
- Now go open an editor to change the code in sketch-#.js files in the public folder.
Create a new sketch
- Stop the server with
ctrl-cfor cancel in the command line.
npm run createto add your own
sketch-#.jsfiles under the
||Start a web server on your own computer|
||Create a new sketch file to start editing|
||Stop a running task|
You will find having the done command line project very useful in order to understand how to start the program and understand what files and paths are and how they relate. Including how to move around the file system.
Our website start project can introduce you to learning more about creating things on the web.
How it works
You don't need to read this to get started, but for the curious this is how the project functions
- A server makes the contents of the
publicfolder accessible by a web browser from the computer running the server.
- When starting, this server lists the files named "sketch-#.js" in that folder to create the menu you see on the page.
- When a page is requested by a user through a browser the server creates an HTML document from the templates in
- Depending on the path the users browsers wants to get, the matching sketch number is added into the page. This logic is contained within
npm run start starts the server by running the program "node" with the file
server.js for you.