Each state and national park has many fun and interesting facts about it. The Touch Grass API only includes one fun fact about each park, but this tutorial describes how to change a fact for a park.
The Touch Grass service contains information about state and national parks in California. In order to access the information, see Get Started.
The service currently requires a local JSON server to make API calls. The server runs in a Git Bash instance, but API calls must be performed in a separate window or program.
Open Git Bash.
Navigate to the cloned folder.
Navigate to the /api
folder.
Enter json-server -w touch-grass-db-source.json
.
These instructions update the fun fact associated with Joshua Tree National Park to the following text:
The night sky in Joshua Tree National Park is one of the darkest in Southern California, offering unforgettable opportunities to view the Milky Way.
Open Postman.
Set the method to PATCH.
http://localhost:3000/parks/3
NOTE: The default domain is localhost:3000
, but it can be changed. To verify the domain, check the JSON server introductory text when it was started.
{
"fun fact" = "The night sky in Joshua Tree National Park is one of the darkest in Southern California, offering unforgettable opportunities to view the Milky Way."
}