8.4.0 • Published 4 years ago

adonis-gbox-provider v8.4.0

Weekly downloads
161
License
-
Repository
-
Last release
4 years ago

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

signatureDescription
adonis gbox:routes˙This command works only on starter. It will export .json file containing information about routes
adonis gbox:registerAdds 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:registerActionsAdds 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.
8.4.0

4 years ago

8.3.0

5 years ago

8.2.0

5 years ago

8.1.0

5 years ago

8.0.1

5 years ago

8.0.0

5 years ago

7.0.3

5 years ago

7.0.2

5 years ago

7.0.1

5 years ago

7.0.0

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.3.4

5 years ago

5.3.3

5 years ago

5.3.2

5 years ago

5.3.1

5 years ago

5.3.0

5 years ago

5.2.2

5 years ago

5.2.1

5 years ago

5.2.0

5 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.1.2

6 years ago

4.1.1

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.5.0

6 years ago

3.4.0

6 years ago

3.3.0

6 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.2.0

6 years ago

1.0.0

6 years ago

0.21.0

6 years ago

0.20.0

6 years ago

0.19.0

6 years ago

0.18.0

6 years ago

0.17.0

6 years ago

0.16.0

6 years ago

0.15.0

6 years ago

0.14.0

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.4.0

6 years ago