Skip to content
AI Monorepos Free online conference · June 23 Join us!

Express API template

A lean Node + Express API with shared libraries and Docker.

Terminal window
npx create-nx-workspace@latest my-workspace --template nrwl/express-api-template
Express API template preview

A lightweight Express API for when you want full control without a framework. Organized routes, a shared utility library, and a Dockerfile - a minimal but real backend that builds fast and is easy to extend.

Highlights

Minimal by design

Just Express and Node - no framework overhead, with a clean route and controller structure.

Share logic in libraries

A shared library shows how to keep business logic out of route handlers and reusable across services.

Ready to containerize

A Dockerfile is included so the API is deployable from the start.

Quickstart

  • Serve the API:
    Terminal window
    npx nx run @express-api-template/api:serve
  • Build the API:
    Terminal window
    npx nx run @express-api-template/api:build
  • Test every project:
    Terminal window
    npx nx run-many -t test
  • Visualize your monorepo's graph in the browser:
    Terminal window
    npx nx graph

What's inside

  • apps/api - Express API with health + sample routes
  • packages/util - shared utility library
  • A Dockerfile for the API

Speed up CI with Nx Cloud

Connect this monorepo to Nx Cloud to share one remote cache across your team and CI, and distribute tasks across machines as it grows.

  • Remote caching shared across your team and CI
  • Distributed task execution with Nx Agents
  • Automated e2e test splitting
  • CI that detects failures and proposes fixes

Learn more