express-motivation
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

express-motivation

Motivational plugin for Expressjs.

NPM Version NPM Install Size

Installation

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install express-motivation

Example

The motivation acts as a small middleware which will append an X-Motivation header to each response.

You can also use the motivationErrorHandler which will print out a standard Oh no! error if there is an INTERNAL_SERVER_ERROR.

const express = require('express')
const app = express()
const {motivation, motivationErrorHandler} = require('express-motivation')

app.use(motivation)
app.get('/', function (req, res) {
  res.send('Hello World')
})
app.get('/error', function (req, res, next) {
  next(new Error("Big Error!"))
}
app.use(motivationErrorHandler)

app.listen(3000)

Philosophy

We spend a whole lot of time writing, testing, and using RESTful APIs. This plugin helps to motivate you along the way.

If you are stuck trying to fix a bug on one of your endpoints, take a step back, and check what motivational phrase you are getting.

Contributing

This is my first opensource project so I have no clue how to organize this. It would be cool to add different languages and configurations for this silly (yet fun) project.

Readme

Keywords

Package Sidebar

Install

npm i express-motivation

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

19.5 kB

Total Files

6

Last publish

Collaborators

  • mikelinhas