<commit_before>mortimer = MOngoose ResT
========================

[![Build Status](https://secure.travis-ci.org/topliceanu/mortimer.png)](https://travis-ci.org/topliceanu/mortimer)


Gist
----

**Mortimer** creates a rest interface for predefined mongoose models and it's powered by express.

Usage
-----

````javascript

var express = require('express');
var Mortimer = require('mortimer');
var Author = ..
var Book = ..

var app = express();


// Initialize mortimer with custom endpoint base urls.
var mortimer = new Mortimer({
    base: '/service/api', // default is /api
    version: 'v2' // default is v1
});


// Let mortimer generate standard endpoints for your model.
mortimer.router(Book).bind(app);
mortimer.router(Author, {version: 'v2'}).bind(app);
// The above will generate GET /api/v2/authors, POST /api/v2/authors, etc.


// OR Use mortimer's middleware functions just for data fetching.
app.get('/api/book/:bookId', [someFancyMiddleware], mortimer.middleware(Book, 'read'));


// Bind app to a port.
app.listen(3000);

````

Resources
---------

1. [W3C HTTP Method Descriptions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)
<commit_msg>Fix endpoint URLs<commit_after>mortimer = MOngoose ResT
========================

[![Build Status](https://secure.travis-ci.org/topliceanu/mortimer.png)](https://travis-ci.org/topliceanu/mortimer)


Gist
----

**Mortimer** creates a rest interface for predefined mongoose models and it's powered by express.

Usage
-----

````javascript

var express = require('express');
var Mortimer = require('mortimer');
var Author = ..
var Book = ..

var app = express();


// Initialize mortimer with custom endpoint base urls.
var mortimer = new Mortimer({
    base: '/service/api', // default is /api
    version: 'v2' // default is v1
});


// Let mortimer generate standard endpoints for your model.
mortimer.router(Book).bind(app);
mortimer.router(Author, {version: 'v2'}).bind(app);
// The above will generate GET /service/api/v2/authors, POST /service/api/v2/authors, etc.


// OR Use mortimer's middleware functions just for data fetching.
app.get('/api/book/:bookId', [someFancyMiddleware], mortimer.middleware(Book, 'read'));


// Bind app to a port.
app.listen(3000);

````

Resources
---------

1. [W3C HTTP Method Descriptions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)

{'fraction_non_alphanumeric': 0.17957446808510638, 'fraction_numerical': 0.017872340425531916, 'mean_word_length': 3.9287211740041927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3763384', 'n_tokens_mistral': 812, 'n_tokens_neox': 760, 'n_words': 206}