Chapter Exercise

Design and Build Great Web APIs — by Mike Amundsen (86 / 127)

The Pragmatic Programmers
The Pragmatic Programmers
2 min readApr 28, 2021

--

👈 What’s Next? | TOC | Chapter 12 Modifying APIs 👉

In this exercise, you’ll get a chance to expand the functionality of newman, the automated testing app we used in Chapter 9, Testing APIs. This time, along with using the newman library to test our package, you’ll get a chance to add an additional step that will automatically deploy your package to the Heroku cloud platform.

In this exercise you’ll need to update the norman utility to handle continuous deployment. There’s a copy of the source code for this utility in the utilities folder of the downloadable source code associated with this book.[94]

To update the utility, you’ll need to go to the code/deploying/exercise/before/norman folder and open the index.js file to locate the commented section with the title add deployment command here. Modify the shell.exec(…) command on the subsequent line to include the correct git command needed to fire off Heroku’s continuous delivery process. (You should need just four keywords on a single line to make this work.)

Once you have the code updated, run the same command as before (norman assets/api-onboarding,postman_collection.json). If all goes well, you should see your project pushed into production again on the Heroku platform.

See Appendix 2 (Solution for Chapter 11: Deploying APIs) for the solution.

Footnotes

[92] http://www.jedi.be/blog/2008/10/09/agile-2008-toronto-agile-infrastructure-and-operations-presentation

[93] https://www.heroku.com

[94] https://pragprog.com/titles/maapis/source_code

Copyright © 2020, The Pragmatic Bookshelf.

👈 What’s Next? | TOC | Chapter 12 Modifying APIs 👉

Design and Build Great Web APIs by Mike Amundsen can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

Unlisted

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.