We will be creating a JSON file to use in our next lab.
- Express Server
- JSON files
- A server that serves a JSON file that you created.
- Create a new subfolder at the top level, called
api. - Within
api, createanswers.json - This JSON should contain the following key-value pairs: name, quest, favorite color.
- Think back to a previous project where you were provided a JSON and use that as a reference for syntax
In your server, use a GET method to serve your 'answers.json' file. If you have done this correctly, when you navigate to the server in the browser at the route of the GET, you will see your JSON.
- A server that serves a JSON file that you created.
- Add multiple values to each key, either as an array or an object. This would allow for multiple names, quests, and favorite colors.