Create awesome Express.js applications with best of breed tech including ES.next via Babel.js, structured logging with Pino, API validation and interactive documentation via Swagger, environment based config with dotenv, linting with ESLint, and Backpack powered builds.
generator-express-no-stress gets you up and running in seconds. It's ridiculously easy to configure. Heck, just take the defaults. Start it. Write code.
This generator scaffolds a fully functioning REST API server complete with interactive documentation, API validation, structured logging, environment driven config, and more. Simply run the generator and smile :-D
Requires Node 6 or greater
npm install -g yo generator-express-no-stress
yo express-no-stress myapp
cd myapp
npm run dev
npm run compile
npm start
e.g. CloudFoundry
cf push myapp
npm test
Run npm run debug
and attach your favourite inspector!
- Interactive API doc at http://localhost:3000/api-explorer
- Landing page at http://localhost:3000
# scaffold
yo express-no-stress myapp --yarn
# start
cd myapp
npm start
yo express-no-stress [appname] [--yarn] [--docker]
Option | default | Description |
---|---|---|
appname |
myapp | The application folder |
--yarn |
Use the yarn package manager, instead of npm |
|
--docker |
Install Docker artifacts including a Dockerfile |
- Express.js - Fast, unopinionated , minimalist web framework for Node.js
- Babel.js - Use new syntax, right now without waiting for support
- Pino - Extremely fast node.js logger, inspired by Bunyan. It also includes a shell utility to pretty-print its log files
- dotenv - Loads environment variables from .env for nodejs projects
- Backpack - a minimalistic build system for Node.js projects.
- ESLint - a pluggable linting utility for JavaScript and JSX
- Swagger - is a simple yet powerful representation of your RESTful API.
- SwaggerUI - dynamically generate beautiful documentation and sandbox from a Swagger-compliant API
Simply describe your APIs with Swagger and automagically get for free:
- Interactive documentation
- API validation
Oops! I the API caller forgot to pass a name
field, no stress, we've got this!
Structured logging out of the box!
Structured logging pretty printed by default - great for dev!
Simply describe your APIs with Swagger and automatically get:
- API request validation
- Interactive documentation
swagger: "2.0"
info:
version: 1.0.0
title: myapp
description: My cool app
basePath: /api/v1
tags:
- name: Examples
description: Simple example endpoints
- name: Specification
description: The swagger API specification
consumes:
- application/json
produces:
- application/json
definitions:
ExampleBody:
type: object
title: example
required:
- name
properties:
name:
type: string
description: The example name
paths:
/examples:
get:
tags:
- Examples
description: Fetch all examples
responses:
200:
description: Returns all examples
post:
tags:
- Examples
description: Create a new example
parameters:
- name: example
in: body
description: number of items to skip
required: true
schema:
$ref: "#/definitions/ExampleBody"
responses:
200:
description: Returns all examples
/examples/{id}:
get:
tags:
- Examples
parameters:
- name: id
in: path
required: true
description: The id of the entity to retrieve
type: integer
responses:
200:
description: Return the example with the specified id
404:
description: Example not
/spec:
get:
tags:
- Specification
responses:
200:
description: Return the API specification
express-no-stress uses ESLint with a slightly modified AirBnb base configuration. See .eslintrc.json
to make modifications.
MIT