1.1.0 • Published 5 years ago

oak-crud v1.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

OAK CRUD API Generator

Generates a CRUD API server, including MongoDB connection, models, routes, logger...

Installing:

    npm install -g oak-crud

Usage:

    oak -f model.json
    
    cd my-api
    
    npm install

    npm run start

or use quick start

    oak -q

model.json format

{
    "appname" : "my-api",
    "models" : [{
        "name" : "books",
        "methods" : ["get", "post", "patch", "put", "delete"],
        "schema": [{
            "name": "name",
            "type": "String",
            "required": true
        },
        {
            "name": "createdDate",
            "type": "Date",
            "default": "Date.now()"
        }]
    }]
}