@bakjs/ratelimit

Please refer to [bakjs/hapi-plugins](https://github.com/bakjs/hapi-plugins) for more info and docs.


Keywords
nodejs, plugin, api, framework, web, rest, minimal, hapi, framrwork
License
MIT
Install
npm install @bakjs/ratelimit@2.1.1

Documentation

Bak.js

Delightful modern web applications framework for hapi.js

Features

βœ“ Built on top of hapi.js, A rich framework for building applications and services

βœ“ Optionally using Controllers for routing

βœ“ Single file configuration without need to extra boilerplate

βœ“ CLI & Dev friendly tools

βœ“ Stable and rich echo-system of hapi compatible plugins

βœ“ Modular design without modifying core

Getting started

Install bak package:

yarn add bak

Create bak.config.js;

export default {
  prefix: '/api',
  routes: [
    './controllers/api'
  ]
}

Create controllers/api.js:

import { Controller } from 'bak'

export default class APIController extends Controller {
  init () {
    this.get('/hello/{name}', this.hello)
  }

  hello (request, reply) {
    return 'Hello ' + request.params.name
  }
}

Start server:

yarn bak dev # Use `yarn bak start` for production mode

Your API is up! Now you can visit http://localhost:3000/api/hello/world for the results.

Inspect mode:

You can pass Node.js supported args after -- arg:

yarn bak dev -- --inspect

License

Released under The MIT LICENSE