New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

restful-fluency

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restful-fluency

A fluent builder for creating REST and HTTP-based APIs.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

restful-fluency

A fluent builder for creating REST and HTTP-based APIs.

Usage

Install the node package:

npm install --save restful-fluency

Import the server builder in your javascript code:

const ServerBuilder = require('./server-builder');

Server Types

Server TypeDescription
DEFAULTUses restify.
RESTIFYUses restify to serve requests.

Server Configuration Options

OptionDescription
whichListensOnPort(port)The port that the server will use to listen for incoming requests.
withARestfulApi()Add a new REST API
build()Builds the server with the current configuration.

REST API Configuration Options

OptionDescription
thatUsesMongoModel(model)The mongo (mongoose) model that will back this REST API.
accessibleFrom(resourcePrefix)The resource prefix to use.
withReadonlyAccess(hasReadAccessOnly)Set this to true if you want to disallow write operations.
and()Finalise the API and go back to configuring the server.

Example

ServerBuilder.DEFAULT
.withARestfulApi().thatUsesMongoModel(productModel).accessibleFrom('product').withReadonlyAccess().and()
.withARestfulApi().thatUsesMongoModel(orderModel).accessibleFrom('order').and()
.whichListensOnPort(8080)
.build();

Keywords

rest

FAQs

Package last updated on 08 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts