npm.io
0.9.6 • Published 2 weeks ago

sbx-rest-gateway

Licence
Version
0.9.6
Deps
22
Size
57 kB
Vulns
7
Weekly
0

Downloads

Rest Moleculer NPM version

Moleculer is a fast, modern and powerful microservices framework for Node.js. It helps you to build efficient, reliable & scalable services. Moleculer provides many features for building and managing your microservices.

Website: https://moleculer.services

Documentation: https://moleculer.services/docs

Requirements

  • node >= 10
  • sbx >=0.9.1

Peer dependencies

Installation
$ npm install sbx-rest-gateway

Use package:

     'get.tournaments.list':{
            route:{
                method: "GET",
                path: 'tournaments/list(/)',
                name: 'Sessions count',
                description: 'Get Sessions count',
                group: 'Tornaments',
                accessGroups: ['tornament'],
                access: ['admin','manager','brand'],
                cache:{
                    ttl: 3600 //seconds,
                    key: ["limit","id"] //get from params and serialize to hash key,
                    type: "cron" // cron | timeline default timeline 
                }
            },
            params: {
                //Parting
                limit: {type: 'number', max:100, min:1, default:20, optional: true, description: '1'},
                offset: {type: 'number', optional: true, default:0, description: '10'},
              
            },
            async handler(){
            }
     }