Simple introduction to creating a REST service and api with node
Clone the repository, then run this command in the project directory to run the server with the latest changes you've made to the api-server.js
file:
node api-server.js
Now you can access the the app at (http://localhost:4000/index.html).
You should see a red background with instructions to "Set up your endpoint at /pokemon
to get this view working".
We will do this in the api-server.js file. Our goal is to send back the list of pokemon declared as an array at the top of the file when the UI requests it from the /pokemon
endpoint. We will know this has worked when a blue screen listing the pokemon shows in our browser.
see api-server.js