• Home
  • Books
  • Node
  • Testing
  • JavaScript
  • More...
  • Search
  • About
  • Gear & Setup

Express

A collection of 8 posts

#node #Express #javascript

Read and parse POST/PATCH/PUT request JSON or form body with Express and no dependencies

When asked to handle data in a request body, developers who have used Express (the “Fast, unopinionated, minimalist web framework for Node.js”) before, reach for the body-parser library. What they might not know is that body-parser is a dependency of Express and its main JSON par ...

  • Hugo Di Francesco
    Author
5 min read
#express #docker #javascript #node

An enterprise-style Node.js REST API setup with Docker Compose, Express and Postgres

The why and how of enterprise-style Node.js application. A setup that’s easy to test and extend using battle-hardened technologies like Express.js, Postgres and Docker Compose to run locally. Dive into the code on GitHub directly: github.com/HugoDF/express-postgres-starter. ...

  • Hugo Di Francesco
    Author
8 min read
#Express #node #jest #Testing #javascript

A testing guide for Express with request and response mocking/stubbing using Jest or sinon

To test an Express handler, it’s useful to know how to successfully mock/stub the request and response objects. The following examples will be written both using Jest and sinon (running in AVA). The rationale for this is the following. Jest is a very popular “all-in-one” testing ...

  • Hugo Di Francesco
    Author
17 min read
#Express #node #javascript #deployment

Node.js configuration management without config or dotenv

The config npm package is great (npmjs.com/package/config), but it encourages confusing and non-12-factor-app-compliant patterns. We’ll look at some of the patterns it encourages and why they’ll bring you struggles down the road as well a simple, single-file, no-dependency way to ...

  • Hugo Di Francesco
    Author
3 min read
#Sequelize #Express #javascript #node

Sequelize Data Types: a practical guide

DataTypes are core to the Sequelize 4 library. This is a practical and complete guide to make up for the sparse Sequelize official documentation on the subject. First of all, DataTypes contains both the types and generators for default values: eg. NOW, UUIDV1 and UUIDV4 are speci ...

  • Hugo Di Francesco
    Author
3 min read
#node #javascript #Express #Docker #redis

Bring Redux to your queue logic: an Express setup with ES6 and bull queue

There always comes a point in a web application’s life where an operation is best served in the background, this is where queues come in. There are a few queuing solutions in Node. None of them are ridiculously dominant, eg. Kue, RSMQ, Bee Queue, bull. The issue with Kue, R ...

  • Hugo Di Francesco
    Author
11 min read
#jest #javascript #node #Express

Testing an Express app with SuperTest, moxios and Jest

Testing is a crucial part of the software development process. It helps to catch bugs, avoid regressions and to document the behaviour of a piece of software. Express is one of the most widespread libraries for building backend applications in JavaScript. What follows is a summar ...

  • Hugo Di Francesco
    Author
6 min read
#express #node #javascript #docker #redis

A Docker/docker-compose setup with Redis and Node/Express

Redis and Express are tools that provide a simple and clean approach to their problem domains. What follows is a Docker/Docker Compose v2 setup. The repo is available at: https://github.com/HugoDF/express-redis-docker. The docker-compose.yml is available at: github.com/HugoDF/exp ...

  • Hugo Di Francesco
    Author
5 min read
Page 1 of 1 

Interested in Alpine.js?

Power up your debugging with the Alpine.js Devtools Extension for Chrome and Firefox. Trusted by over 15,000 developers (rated 4.5 ⭐️).

Install Now close
Code with Hugo
Latest Posts Github