express middleware for handling api quota

Usage no npm install needed!

<script type="module">
  import anytvNodeQuota from '';


Build Status"> Dependency Status devDependency Status Code Climate AnyTV Middleware for Quota


npm install anytv-node-quota --save
npm install anytv-node-mysql --save

How to use

// include packages
const quota = require('anytv-node-quota')
const mysql = require('anytv-node-mysql')

// add db key 'accounts_db' to anytv-node-mysql
mysql.add('accounts_db', config.ACCOUNTS_DB)

// create instance of quota store by passing anytv-node-mysql db instance
let quota_store =
// create instance of quota middleware by passing (<instance of quota_store>, <service name>, <log request>)
let quota_middleware = quota.middleware(quota_store, 'default', true)

// use quota in your routes and controllers
router.get('/', (req, res) => {
    // set endpoint weight

    // some codes here

    res.send({success: 'it is working.'})