Loopback
The shared localhost server plumbing: bind on 127.0.0.1 with an ephemeral port, JSON responses, and the
default 404.
Summary
Functions
Section titled “Functions”Loopback . serve ( settings ) -> Server
Starts a Zune HTTP server on 127.0.0.1 with an ephemeral port.
Parameters
| settings: any |
Returns
| Server |
upgradePath
Section titled “upgradePath”Loopback . upgradePath ( request ) -> string
The path of a websocket upgrade request with one trailing / removed: /resume/ becomes /resume, / stays.
Parameters
| request: Request |
Returns
| string |
jsonResponse
Section titled “jsonResponse”Loopback . jsonResponse ( statusCode , value ) -> Response
Builds a JSON response with statusCode and value.
Parameters
| statusCode: number | |
| value: any |
Returns
| Response |
notFoundResponse
Section titled “notFoundResponse”Loopback . notFoundResponse ( ) -> Response
The JSON 404 every default route falls through to.
Returns
| Response |