npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

adonis-gbox-provider

v8.4.0

Published

Provider for integrating adonis framework into gaussbox api

Downloads

19

Readme

Adonis GaussBox provider

Provider for integrating adonis framework into GaussBox API

Instalation

  1. Install provider

npm install adonis-gbox-provider

  1. Add configuration

Inside config/database.js

crm: {
        client: 'mysql',
        connection: {
            host: Env.get('DB_CRM_HOST'),
            port: Env.get('DB_CRM_PORT'),
            user: Env.get('DB_CRM_USER'),
            password: Env.get('DB_CRM_PASSWORD'),
            database: Env.get('DB_CRM_DATABASE')
        },
        debug: Env.get('DB_DEBUG', false)
    }

Add appropriate variables to .env

Only if using with adonis starter:

Inside config/gaussbox.js

module.exports = {
    routeExporter: {
        serviceName: 'cms-api',
        mapping: [
            {
                fileName: 'Post.js',
                prefix: 'posts'
            },
            {
                fileName: 'PostType.js',
                prefix: 'post-types'
            }
            /* and so on */
        ]
    }
}
  1. Register providers

Inside start/app.js

const providers = [
    'adonis-gbox-provider/Providers/GBoxProvider'
]
const aceProviders = [
    'adonis-gbox-provider/Providers/CommandsProvider'
]
  1. Register middleware

Inside start/kernel.js

const globalMiddleware = [
    'GBox/Parser',
]
  1. Add to .env

Following variables:

GAUSSBOX_SECRETE

GAUSSBOX_GET_SECRET

IS_GBOX=true //put to false if your requests do not go through master API (You are developing your app locally)

If using starter, still keep HandleResponse on top

Middleware

Middleware (GBox/Parser) will add to context following variables:

body

user

application

If IS_GBOX is set to true, it will parse those from master API request. Otherwise it will parse those from regular request

Commands

signature | Description --------- | ----------- adonis gbox:routes˙| This command works only on starter. It will export .json file containing information about routes adonis gbox:register | Adds your routes to api, module and routes to database. Requires exported routes. If not using starter, and therefor command above, you need to provide this data file adonis gbox:registerActions | Adds your rotes to crm database, not touching api and modules. Useful if you registered your api already and want to update routes. Same rules about starter as above.