These are the steps you must do before you can run the tutorials for the To-Do service.
Expect this preparation to take about 20 minutes to complete.
To complete the tutorials in this section, you need the following. You might want to open the links in separate browser tabs before you start installing the software.
node.js
A current copy of the database file. You can get this by syncing your fork.
Tip: if you’re using a fork of the repository, create a working branch in which to do your tutorials. Create a new branch for each tutorial to prevent a mistake in one from affecting your work in another.
http://localhost
host name, the web-version of Postman can’t perform the exercises.http://localhost
host name, the web-version of Postman can’t perform the exercises.To test your development system:.
Create and checkout a test branch of your fork of the To-Do-service repository. Your GitHub repository workspace
is the directory that contains your fork of the to-do-service-sp25
repository.
cd <your GitHub repository workspace>
ls
# (see the to-do-service directory in the list)
cd to-do-service-sp25
git checkout -b tutorial-test
cd api
json-server -w to-do-db-source.json
If you installed the software correctly, you should see
the service start and display the URL of the service: http://localhost:3000
.
Make a test call to the service.
curl http://localhost:3000/users
If the service is running correctly, you should see a list of users from the service, such as in this example.
[
{
"last_name": "Smith",
"first_name": "Ferdinand",
"email": "f.smith@example.com",
"id": 1
},
{
"last_name": "Jones",
"first_name": "Jill",
"email": "j.jones@example.com",
"id": 2
},
...
You should see the list of users. If you receive an error in any step of the procedure, investigate, and correct the error before continuing. Some common situations that cause errors include:
If you see the list of users from the service, you’re ready to do the Tutorials.