UNPKG

mockapi

Version:

A quick and dirty api framework. Great for quickly mocking out or prototyping an api.

10 lines (8 loc) 227 B
'use strict'; module.exports = function notFoundHandler() { var notFoundJson = JSON.stringify({ error: { message: 'Route not found' } }); return function(req, res) { res.status(404); res.end(notFoundJson); }; };