GithubHelp home page GithubHelp logo

dannychansz / node-odata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zackyang000/node-odata

0.0 2.0 0.0 611 KB

A library for easily create OData REST API, abide by OData protocol.

Home Page: http://tossshinhwa.github.io/node-odata/en/

License: MIT License

Makefile 0.60% JavaScript 33.73% CoffeeScript 65.68%

node-odata's Introduction

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 Coverage Status Dependency Status License

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

var server = odata('mongodb://localhost/my-app');

server.resource('books', { 
  title: String, 
  price: Number 
});

server.listen(3000);

Registers the following routes:

GET    /books
GET    /books(:id)
POST   /books
PUT    /books(:id)
DELETE /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 beta stage, it is stable but not 100% feature complete. node-odata is written by ECMAScript 6 then compiled by babel. It currently have to dependent on MongoDB yet. The current target is to add more features (eg. $metadata) and make to support other database. (eg. MySQL, PostgreSQL).

Installation

npm install node-odata

DOCUMENTATION

Demo

Live demo and try it:

Support Feature

  • Full CRUD Support
  • $count
  • $filter
    • Comparison Operators
      • eq
      • ne
      • lt
      • le
      • gt
      • ge
    • Logical Operators
      • and
      • or
      • not
    • Comparison Operators
      • has
    • String Functions
      • indexof
      • contains
      • endswith
      • startswith
      • length
      • substring
      • tolower
      • toupper
      • trim
      • concat
    • Arithmetic Operators
      • add
      • sub
      • mul
      • div
      • mod
    • Date Functions
      • year
      • month
      • day
      • hour
      • minute
      • second
      • fractionalseconds
      • date
      • time
      • totaloffsetminutes
      • now
      • mindatetime
      • maxdatetime
    • Math Functions
      • round
      • floor
      • ceiling
  • $select
  • $top
  • $skip
  • $orderby
  • $expand
  • $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.

node-odata's People

Contributors

zackyang000 avatar afska avatar qknow-w avatar vincent178 avatar

Watchers

James Cloos avatar Danny Chan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.