iseekr-data-bucket
A module for easily create a REST API based on oData protocol
Last updated 5 years ago by airyland .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install iseekr-data-bucket 
SYNC missed versions from official npm registry.

node-odata

Create awesome REST APIs abide by OData Protocol v4. Its purpose is to easier to creating APIs, make you more focus on business logic.

NPM Version npm Build Status License

var odata = require('node-odata');

odata.set('db', 'mongodb://localhost/my-app');

odata.resources.register({
    url: '/books',
    model: {
        title: String,
        price: Number
    }
});

odata.listen(3000);

Registers the following routes:

GET    /odata/books
GET    /odata/books/:id
POST   /odata/books
PUT    /odata/books/:id
DELETE /odata/books/:id

Use the following OData query:

Example
GET /books?$select=title, author
GET /books?$top=3&$skip=2
GET /books?$orderby=price desc
GET /books?$filter=price gt 10
GET ...

Current State

node-odata is currently at an alpha stage, it is stable but not 100% feature complete. node-odata is written by CoffeeScript then compiled to Javascript. It currently have to dependent on MongoDB yet. The current target is to add more features and make other database adapter (eg. MySQL, PostgreSQL).

Install

npm install node-odata

API

Docs

Demo

Live demo and try it:

Support Feature

  • [x] Full CRUD Support
  • [x] $count
  • [x] $filter
    • [x] Comparison Operators
      • [x] eq
      • [x] ne
      • [x] lt
      • [x] le
      • [x] gt
      • [x] ge
    • [ ] Logical Operators
      • [x] and
      • [ ] or
      • [ ] not
    • [ ] Comparison Operators
      • [ ] has
    • [ ] String Functions
      • [x] indexof
      • [ ] contains
      • [ ] endswith
      • [ ] startswith
      • [ ] length
      • [ ] substring
      • [ ] tolower
      • [ ] toupper
      • [ ] trim
      • [ ] concat
    • [ ] Arithmetic Operators
      • [ ] add
      • [ ] sub
      • [ ] mul
      • [ ] div
      • [ ] mod
    • [ ] Date Functions
      • [x] year
      • [ ] month
      • [ ] day
      • [ ] hour
      • [ ] minute
      • [ ] second
      • [ ] fractionalseconds
      • [ ] date
      • [ ] time
      • [ ] totaloffsetminutes
      • [ ] now
      • [ ] mindatetime
      • [ ] maxdatetime
    • [ ] Math Functions
      • [ ] round
      • [ ] floor
      • [ ] ceiling
  • [x] $select
  • [x] $top
  • [x] $skip
  • [x] $orderby
  • [ ] $expand
  • [x] $metadata generation (Nonstandard)

CONTRIBUTING

We always welcome contributions to help make node-odata better. Please feel free to contribute to this project.

LICENSE

node-odata is licensed under the MIT license. See LICENSE for more information.

Current Tags

  • 0.3.1                                ...           latest (5 years ago)

1 Versions

  • 0.3.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |