Class: AbstractBREADProvider

AbstractBREADProvider(req, res, next, optionsopt)

This is a generic class to provide middleware for Browse/Read/Edit/Add/Delete operations and forms. It comes with some baked-in pre-flight checks but needs to be extended to do useful work. All default actions except reads require being logged in.

Use the bakery method to create standard BREAD routes. :)

Constructor

new AbstractBREADProvider(req, res, next, optionsopt)

Parameters:
Name Type Attributes Description
req IncomingMessage

Express request

res ServerResponse

Express response

next function

Express callback to move on to next middleware

options Object <optional>

What kind of route to create

Properties
Name Type Default Description
action String 'add'

one of 'browse', 'read' (view), 'add' (create), 'edit', 'delete'

method String 'GET'

what HTTP method this route responds to

id String

if required, what object ID to look up

someOtherID String

will also be assigned to this

Source: