Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Beginning API Development with Node.js

You're reading from   Beginning API Development with Node.js Build highly scalable, developer-friendly APIs for the modern web with JavaScript and Node.js

Arrow left icon
Product type Paperback
Published in Jul 2018
Publisher Packt
ISBN-13 9781789539660
Length 100 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Anthony Nandaa Anthony Nandaa
Author Profile Icon Anthony Nandaa
Anthony Nandaa
Arrow right icon
View More author details
Toc

Building the API - Part 2

This chapter is intended to revisit the previous implementation, this time saving our data in a persistent storage (database). It will also cover authentication, and unit testing and hosting as additional good-to-know concepts (but not essential). It is therefore prudent to put more emphasis on working with the DB using knex.js and authenticating your API with JWT.

By the end of this chapter, you will be able to:

  • Implement database connection with Knex.js
  • Describe commonly used Knex.js methods
  • Rewrite our previous implementation of the todo routes with Knex.js
  • Implement API authentication with JWT
  • Describe the importance of having unit tests for your API
  • Implement basic testing of the API with Lab
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime