... in the previous chapters...
How to create a simple contact form with Node.js?
Project initialization. Let's start by creating an empty folder and initializing our
package.json with npm init. We will also include express to set up our application, express-validator to validate the form submission, and mustache (mustache-express) to render the form.npm init -y npm i --save express express-validator mustache-express The basics. With our packages ready, let's go on and create our index.js. We will...How to create a simple HTTP API with authentication with Node.js?
In this example we'll see how to create an HTTP API with 3 main components: Signup, Login and a login-only route. Let's start by setting up a new project and including Express for handling the routes, JSON Web Token to handle auto-expiring tokens, and bcrypt to encrypt user passwords. Initialize the new project in an empty folder. We'll name the main file
index.mjs to utilize top level awaits and have import/export functionality.npm init -y npm i --save express jsonwebtoken bcrypt...How to save a web page as PNG or PDF with Nightmare?
Introduction In this example we'll see how to utilize Nightmare, Xvfb and how to properly bootstrap the main application code in order to make a cross-platform HTML → PDF script.
Let's start by initializing our application packages and preparing the application index.js. While we are in our new application folder, let's create a default package.json and install the packages:
Let's start by initializing our application packages and preparing the application index.js. While we are in our new application folder, let's create a default package.json and install the packages:
npm init -y npm i --save nightmare @cypress/xvfb...