fluent-rest

0.0.32 • Public • Published

Fluent REST

A flexible fluent library that automatically creates Express compatible RESTful endpoints for any sql-bricks compatible database connection.

Build: master

Features

  • Fully RESTful endpoints without any weird query string madness or RPC masquerading as REST
  • Select the fields returned for entities using the fields query string parameter
  • Control the sort order of entities returned from collections via the sort query string parameter
  • Support full-text searches via the q query string parameter and a custom entity configurable via use_full_text_entity
  • Accept header/extensions can be easily honored in output formatters
  • Chainable output formatters, similar to Express middlewares, allow you to fully customize what is sent back to the client

Installation

$ npm install fluent-rest

Usage

// Standard Express app set up code would be here
 
import { rest_service_builder, hal_formatter } from 'fluent-rest/rest_service_builder';
let db = require('pg-bricks').configure('YOUR CONNECTION STRING');
 
let customers = builder
  .mount_at(app, '/api/v1')
  .resource('customers')
  .description('This is a collection of customers.')
  .for_entity(db, 'customer')
  .endpoint();
 

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.321latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.321
0.0.310
0.0.300
0.0.272
0.0.260
0.0.250
0.0.240
0.0.220
0.0.211
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.61
0.0.50
0.0.40
0.0.30
0.0.20

Package Sidebar

Install

npm i fluent-rest

Weekly Downloads

5

Version

0.0.32

License

LGPL-2.1

Last publish

Collaborators

  • jeffpanici75