Any sufficiently advanced technology is indistinguishable from magic.
— Arthur C. Clarke
dog-ceo-api
by @ElliottLandsborough.
Duty Calls by @xkcd.
Outer Space by @nasa.
In this assignment you’ll fetch data from an external rest api
.
- Homework
- Time: 2:00h
- Goals: subgoal 7, subgoal 8, subgoal 9, subgoal 10, and subgoal 12
- Due: before lab 4
- Stuck? See the Bugs section of the course readme to find a list of troubleshooting tips
Take ± 2 hours to make a request to an external api
and render the data coming back.
Research
Take about 0:30h to investigate different ways to get data from an api.
- What's the difference between client-side requests (using
XMLHttpRequest
orFetch
) and doing these server-side (usinghttp
orrequest
)? - What types of API's are there?
- Which
types of data
do you get?
Build
- Make a request to an external public API
public APIs
is a collective list of free APIs you can use.- You can pick one which has no
auth
such asRandomCat
orMetaWeather
- Render the data coming back using your
template engine
- You will likely recieve
JSON
you'll need to convert
- You will likely recieve
Optional:
- You can pick an API with
auth
but then you need to work with API keys, can you get that working? - Can you normalize or make a subset of the data?
- These
array.protoype
higher order functions might come in handy.
- These
Archive storage by @samuelzeller.
Work on receiving user input and manipulating data for your own Job Story.
- Homework
- Time: 6:00h
- Goals: subgoal 7, subgoal 8, subgoal 9, subgoal 10, and subgoal 12
- Due: before lab 4
- Stuck? See the Bugs section of the course readme to find a list of troubleshooting tips
Take ± 6 hours to build out a feature were you'll receive user input and manipulate the data. This is quite a vague assignment and the end result will be specific to your Job Story. Make sure you at least spend the alloted hours on this.
Some examples to get you started, think about the movie example from the lecture:
- You can make users upload a profile picture
- Add new users to an overview list of people
- Make users enter their hobbies and interests
- Etc.
Try to break down in small functionalities and think about what steps you need to complete.
- How do you render (send) data inside of your template?
- Do you need to create a form as a
partial
with the corresonpdingattributes
? - What type of request do you need to send? Is a
post
needed? - Any packages from
npm
you can use? Maybeslug
,body-parser
ormulter
?
Commit your work early and often. Push your work to GitHub. Don’t worry if it’s not perfect. Try and get as far as you can.
-
Push your changes:
Hand in your progess in your repository on GitHub under your username. -
Create an issue:
Mark this assignment as complete by opening an issue on our GitHub issue tracker. Fill in the issue template with the correct information. Make sure, in your repository, you include the resources used and update yourreadme.md
and wiki with additional information. -
Feedback:
Let us know what you thought of the homework, what part you spend a lot of time on and give us any feedback. Your project will be reviewed and receive feedback, so expect people to read it, and be ready for tips and tops!