Pre-Course Setup
Complete the following setup so you can do the course exercises. It should take less than 15 minutes.
1. Download the code
- Install git, if you don’t already have it installed.
- Install Node.js v18.16.0.
- Download the source code repository and unzip it. This is the origin repo. You won’t be working out of these files.
- Clone the origin repo into a convenient folder. This folder is the working directory you’ll be coding in.
git clone --config core.autocrlf=false <path_to_origin_repo> <path_to_working_directory>
2. Test the build
- Open a command prompt and navigate to the working directory.
- Run the self-check script. It will check out all the exercise branches and make sure they build. It will take about a minute, maybe two.
- Windows:
.\self_check.cmd
- Mac/Linux:
./self_check.sh
- Windows:
- Confirm that the script ends with
SELF-CHECK OK
.- If it doesn’t, make sure you have the correct version of Node.js installed. There will be a warning banner if you don’t.
3. Test the watch script
- Open a command prompt and navigate to the working directory.
- Run the watch script.
- Windows:
.\watch.cmd quick
- Mac/Linux:
./watch.sh quick
- Windows:
- Confirm that the script says
BUILD OK
. On Mac and Windows, it should also play a sound. - Make a change to a source file, such as
src/serve.js
, and save it. - Confirm that the script runs the build again.
If the build times out:
- Edit
build/scripts/watch.js
and change theTIMEOUT_IN_MS
constant at the top of the file.
If the sounds cause problems, or if you just don’t like them:
- Edit
build/scripts/watch.js
and change thePLAY_SOUNDS
constant at the top of the file.
That’s it!