The twelve-factor app is a development and deployment methodology for building apps with present-day concepts. Following it will ensure your app can be deployed easily and scaled effortlessly.
The website 12factor.net explains the concepts of the twelve-factor app. The lessons in this course each directly relate to one of the 12 factors and are presented in order. The first few go over revision control and managing the config and dependencies of your Node.js app, while the rest explain the devops of your app with Nginx & Docker, with concepts closely aligned to the 12-factor app.
In this lesson we will initialize our Express application using
After loading express through npm we will look at a couple basic functions Express exposes to us such as
.send. This will allow basic interaction via the url.
We will also see how using a package like
nodemon can allow for rapid iteration when developing an application.
hapi is a rock solid server framework for Node.js. Its focus on modularity and configuration-over-convention makes it the perfect match for any size development team. This video will introduce you to hapi by showing you the bare minimum needed to run a hapi server.
We take advantage of the new Node.js features like
async/await from ES2017 and the awesome
yarn package-manager to create modern JSON APIs with Koa v2. Make sure you have at least Node.js 7.6.x installed.
ctx (context) variable encapsulates a Request and Response object, they are similar to what we already know about the
res objects from the Express.js framework, but it is more expressive and easy to understand thanks to its getters, _setters and some shortcuts. It also parses the response content and sets the
Content-Type header based on the type of its body property. Finally, we can manually set the response headers and status code.
The HTTP client from the video is wuzz.