Class: LinoApp

LinoApp(optionsopt)

An Express application that speaks Links Notation.

Constructor

new LinoApp(optionsopt)

Parameters:
Name Type Attributes Description
options object <optional>

Application options

Properties
Name Type Attributes Description
title string <optional>

Service title used in the description

version string <optional>

Service version used in the description

description string <optional>

Prose description of the service

cors boolean | object <optional>

Enable CORS, optionally with a policy

describe boolean <optional>

Serve the service description (default true)

supported Array.<string> <optional>

Representations the server may produce

maxBodyBytes number <optional>

Largest accepted request body

exposeStack boolean <optional>

Attach stack traces to 5xx problems

defaultLimit number <optional>

Default collection page size

maxLimit number <optional>

Largest collection page size

Source:

Classes

LinoApp

Methods

delete(path, handler, metaopt) → {LinoApp}

Register a DELETE handler.

Parameters:
Name Type Attributes Description
path string

Path pattern

handler function

Route handler

meta object <optional>

Description metadata

Source:
Returns:

This application, for chaining

Type
LinoApp

describe() → {object}

The native service description of specification ยง9.

Source:
Returns:

Description document

Type
object

get(path, handler, metaopt) → {LinoApp}

Register a GET handler.

Parameters:
Name Type Attributes Description
path string

Path pattern

handler function

Route handler

meta object <optional>

Description metadata

Source:
Returns:

This application, for chaining

Type
LinoApp

getExpressApp() → {object}

The underlying Express application, usable as a request listener.

Source:
Returns:

Express application

Type
object

listen(port, callbackopt) → {object}

Start an HTTP server.

Parameters:
Name Type Attributes Description
port number

Port to listen on

callback function <optional>

Called once the server is listening

Source:
Returns:

Node HTTP server

Type
object

openapi() → {object}

The OpenAPI 3.1 rendering of the service description.

Source:
Returns:

OpenAPI document

Type
object

patch(path, handler, metaopt) → {LinoApp}

Register a PATCH handler.

Parameters:
Name Type Attributes Description
path string

Path pattern

handler function

Route handler

meta object <optional>

Description metadata

Source:
Returns:

This application, for chaining

Type
LinoApp

post(path, handler, metaopt) → {LinoApp}

Register a POST handler.

Parameters:
Name Type Attributes Description
path string

Path pattern

handler function

Route handler

meta object <optional>

Description metadata

Source:
Returns:

This application, for chaining

Type
LinoApp

put(path, handler, metaopt) → {LinoApp}

Register a PUT handler.

Parameters:
Name Type Attributes Description
path string

Path pattern

handler function

Route handler

meta object <optional>

Description metadata

Source:
Returns:

This application, for chaining

Type
LinoApp

resource(path, store, optionsopt) → {LinoApp}

Register a CRUD resource, see registerResource.

Parameters:
Name Type Attributes Description
path string

Collection path

store object

Resource store

options object <optional>

Resource options

Source:
Returns:

This application, for chaining

Type
LinoApp

route(method, path, handler, metaopt) → {LinoApp}

Register a handler for a method and path.

Parameters:
Name Type Attributes Description
method string

HTTP method

path string

Path pattern

handler function

Route handler

meta object <optional>

Description metadata, for example summary

Source:
Returns:

This application, for chaining

Type
LinoApp

use(…args) → {LinoApp}

Add Express middleware to the user router.

Parameters:
Name Type Attributes Description
args any <repeatable>

Middleware arguments

Source:
Returns:

This application, for chaining

Type
LinoApp