Superheroic NodeJS web API Generator
Last updated 4 months ago by matheusrabelo .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install apimov 
SYNC missed versions from official npm registry.


npm version

Ultra lightweight library to generate internal APIs.


From now on, you can create an API just with SQL queries and a single json file.


Create your own apimov.json with your API spec.

Run the following command:

$ npm install apimov -g
$ apimov

This command will find and mount an API via apimov.json

Creating an apimov.json

The apimov.json has the following structure:

    "config": {
        "host": "localhost",
        "user": "admin",
        "database": "invoices-db",
        "port": 5432,
    "routes": [
            "path": "/invoices/:invoiceId",
            "method": "GET",
            "query": "queries/get-invoice-by-id.sql"
            "path": "/invoices",
            "method": "GET",
            "query": "queries/get-invoices.sql"


This repo has an usage example, with just the queries/ folder and the apimov.json, you can start an API by running the Apimov CLI. Fork/clone this repo and try to do this on the example/ folder.

Relevant infos

  1. All queries are executed on PostgreSQL. If you are getting started with it, you can try:

or just

  1. The driver used is pg. Configurations and queries contracts are the same avaiable on it.

  2. Apimov unrolls and concats params, query strings and body (in this order) before querying. Don't forget that your queries should consider it. The apimov source code is:

const body = Object.values(reqBody);
const queryParams =
        [].concat(params, queryString, body);


Contributions, stars and feedbacks are always welcome


Today 0
This Week 0
This Month 11
Last Day 0
Last Week 0
Last Month 10
Dependencies (4)
Dev Dependencies (7)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |