To run the Well-Read Service, you must have the following prerequisites in your system:
After you have all the prerequisites in your system, test the service by running a basic API request.
Expect this preparation to take about 20 minutes to complete.
To get the well-read-db.json
database file, please contact the technical writer for the API documentation.
Once you have access to the file, download and save it to an easily accessible location in your system.
To download and install the JSON server, follow the instructions on the software’s official website.
To download and install the Postman desktop app, follow the instructions on the app’s official website. Because you’re running the Well-Read Service locally in your system, you can’t use the web version of Postman.
You can use a built-in command-line tool in your operating system or your preferred command-line tool.
Now that you have all the prerequisites in your system, it’s time to test the service by running a basic API request:
Open your preferred command-line tool and run the following command:
cd <directory of the database file location>
json-server well-read-db.json
If you installed the software correctly, you should see
the service start and display the URL of the service: http://localhost:3000
.
Keep the JSON server running in that window and open another window of the command-line tool to make the following test call to the service:
curl {base_url}/books
If the service is running correctly, you should see a list of books from the service, such as in this example:
{
"title": "Red Rising",
"author": "Pierce Brown",
"page_count": 400,
"subgenre":"science_fiction",
"pace": "fast",
"tags":["violence", "war", "dark"],
"is_series":"true",
"id": 1
}
If you receive an error during any step of the test, here are some common issues that may have caused the error:
If you successfully completed the test, you’re ready to do the quickstart tutorial or the other available tutorials.