Building APIs with Node.js by Caio Ribeiro Pereira

By Caio Ribeiro Pereira

This quickly advisor teaches you ways to construct scalable APIs utilizing the Node.js platform and ES6 (EcmaScript 2015).

Developing platforms for the big variety of units to be had within the glossy global calls for the development of APIs designed to paintings in basic terms with info in a centralized demeanour, permitting client-side purposes to be constructed individually and feature a distinct interface for the ultimate person.

Node.js has confirmed itself to be a superb platform for construction relaxation APIs as a result of its single-thread structure. It has a low studying curve and will be understood by way of a person who has a uncomplicated realizing of the JavaScript language.

Use Building APIs with Node.js this present day to appreciate how Node.js APIs paintings, and the way you could construct your own.

What you'll Learn

  • How to construct scalable APIs utilizing the Node.js platform
  • How to take advantage of ES6, exhibit, Passport, ApiDoc, Mocha, Helmet and more
  • How to combine an SQL database via Sequelize.js and construct a unmarried web page program utilizing Vanilla.js

  • Who This ebook Is For
    Ideal for builders who've a simple realizing of JavaScript and Node.js.

    Show description

    Read Online or Download Building APIs with Node.js PDF

    Similar javascript books

    .net (September 2015)

    . web is the world's best-selling journal for net designers and builders. each factor boasts pages of tutorials overlaying themes resembling CSS, Hypertext Preprocessor, Flash, JavaScript, HTML5 and internet pictures written by way of a few of the world’s most useful internet designers and artistic layout businesses. Interviews, beneficial properties and professional advice additionally supply suggestion on website positioning, social media advertising, webhosting, the cloud, cellular improvement and apps, making it the basic advisor for useful website design.

    AIR for Javascript Developers Pocket Guide

    In case you are already acquainted with HTML and JavaScript and would need to enhance laptop purposes utilizing Adobe AIR then this is often the proper e-book for YOU. In a nutshell, there are a number of methods to constructing AIR functions: 1. utilizing HTML and JavaScript 2. utilizing Flex three. utilizing FlashObviously, this ebook focuses mostly at the first merchandise.

    Object-Oriented Programming: with Prototypes

    Object-oriented programming is a well-liked buzzword nowadays. what's the explanation for this reputation? Is object-oriented programming the answer to the software program concern or is it only a fad? Is it an easy evolutionary step or a thorough switch in software program method? what's the critical thought at the back of object-orien­ ted layout?

    What Every JavaScript Developer Should Know About ECMAScript 2015

    The 2015 specification for the JavaScript language introduces periods, modules, arrow capabilities, and extra. I sat down and wrote the publication i want to examine those new positive aspects. This ebook isn't really an exhaustive record of every little thing new within the ECMAScript 2015 specification that governs the JavaScript language.

    Extra resources for Building APIs with Node.js

    Sample text

    48 CHAPTER 7 Authenticating Users Our API already has tasks and users resources, which, thanks to the Sequelize framework, are integrated into a SQL database, in our case SQLite3. We have already implemented their routes via the main routing functions provided by Express. In this chapter, we explore the main concepts and implementations of user authentication. After all, this is an important step to ensure that our users can manage their tasks safely. js module that is easy to work with for user authentication called Passport.

    Id that could modify the id of a model. all() middleware. The implementation of this route will be like this piece of code. message}); }); }); Finding a Task Via GET Now we are going to treat the /tasks/:id endpoints. all() function. findOne({where: {id: "1"}}). It does a single search of tasks based on the task id. sendStatus(404) function. It should look like this. message}); }); }) Updating a Task Via PUT Now we are going to implement a function to update a task in the database. update() function with a first parameter in which you have included an updated object and, in the second one, an object with parameters to find the current task to be updated.

    FindById() function. This parameter allows us to return some selected fields from a model’s result instead of the full data of a model. js file, using this code. route() here is because in the next chapter, we are going to modify some specific points on each user’s route, to find or delete only if the user is logged into the API. Testing Endpoint Access Using Postman To test these modifications, restart the application, open the browser and use some REST client application, because it will be necessary to test the POST, PUT, and DELETE HTTP methods.

    Download PDF sample

    Rated 4.13 of 5 – based on 30 votes