Kvell.js

Kvell.js

  • Docs
  • Database Plugins
  • Github

›Getting Started

Getting Started

  • Introduction
  • Install
  • kvell.config.js
  • kvell-plugins.js
  • Available Scripts
  • Packages Used In Kvell
  • API

Guide

  • Folder Structure
  • Global
  • Routes and Controllers
  • Models
  • Api Documentation
  • Logging in Kvell
  • Using Custom Ports in Development
  • Debugging in Kvell

Auto-Templating

  • Overview
  • Using generation scripts
  • Using kvell.config.js
Edit

kvell-plugins.js

This file stores the any plugin based configurations in kvell. Currently kvell supports only Database Plugins but more kinds of plugins may be added in the future.

databasePlugins

databasePlugins: Array<object>

Kvell.js supports a plugin based approach for adding a database in your application. To do so, you need to add a databasePluginsObject in the databasePlugins array of your app's kvell-plugins.js. Database plugins can be configured in kvell-plugins.js as an object with the following fields:

Each databasePluginObject must consists of the following fields:

  • resolve: Name of the plugin
  • options: Any options that are required to be passed for instantiating the plugin.

More fields may be added depending on the plugin's requirements.

databasePlugins: [
  {
    resolve: string,
    options: object
  }
];

For example, to add the sequelize plugin for kvell, we can append the following object in the databasePlugins field of kvell-plugins.js:

// kvell-plugins.js
module.exports = {
  databasePlugins: [
    {
      resolve: "kvell-db-plugin-sequelize",
      options: {
        database: process.env.DATABASE_NAME,
        username: process.env.DATABASE_USERNAME,
        password: process.env.DATABASE_PASSWORD,
        options: {
          dialect: "mysql",
          host: "localhost",
          logging: false,
          dialectModulePath: require.resolve("mysql2")
        }
      }
    }
  ]
};

Refer Database Plugins for more details on this field.

Last updated on 7/16/2020 by Neeraj Sharma
← kvell.config.jsAvailable Scripts →
  • databasePlugins
Kvell.js
Docs
Getting StartedGuidesDatabase Plugins
Social
kvell
Follow @nsharma1396
Copyright © 2020 Neeraj Sharma.