Quick Index
Purpose
Web APIs are a hot topic right now in the dev world.
So let's give them a try. We'll work both the provider and consumer sides.
Keep an eye out for new terms. Here are some we should learn:
- Endpoints
- URL
- URL path
- URL query or query params
- API
- API Provider
- API Consumer
- JSON
- API Key
Guide Examples
You will find concepts and examples here.... Specifically you'll find examples (and example source code) that parallel the three items in the "Problem Statement" below.
Problem Statement
Code the following:
- Custom API Provider
- Custom API Consumer
- Public API Consumer
General
Specs:
- You can use the guide examples or other sources (as long as it's coded in Node.js)
- You can code tight to the examples or go wild with your own creativity (coder's choice)
- Please use project directory names as shown below
- Please name your entry point (runnable js file) "main.js" (in each project root dir). This is how the grader will run your code e.g. "node main".
Project directory names:
- custom-api-provider
- custom-api-consumer
- public-api-consumer
Custom API Provider
Specs:
- Please authenticate (restrict access) using an API key
- Please grant access to API key "Z283794" to make it easy for the grader
- Please come up with your own calculations (you can follow the general code pattern of the guide examples if you like).
- Your calcs can be simpler or more complex than the examples
Tips:
- Your model/computation logic can be as simple or as sophisticated as you like.
- The guide example API provider handles three different api endpoints (URL paths). You only need to handle one (but more is fine).
- In the examples, the "english-translator.js" is probably the simplest model, and your functionality could even be simpler if you prefer.
Custom API Consumer
Specs:
- This app should consume the "Custom API Provider".
- Please print out the results (based on data received from the API provider) in the console.
- Note Well -- when the grader runs this via "node main", the output should show in the console.
Public API Consumer
Specs:
- You can use the same public API used in the example, or better yet you can find an API of interest. Both options will be graded the same, but the latter may be more enjoyable.
- Please print out the results (based on data received from the API provider) in the console.
- Note Well -- when the grader runs this via "node main", the output should show in the console.
Tips:
- There are many public APIs out there. Note that not all are free, and they will vary in user-friendliness/docs etc.
Submitting
- Before archiving, please delete all project "node_modules" sub-directories (if/when present). Here is why...
- Create a ZIP archive file named in the normal way
- Please copy your three project directories into the archive.
- Please do not nest archives
- Submit in D2L in the normal way
References