Kvell.js

Kvell.js

  • Docs
  • Database Plugins
  • Github

›Auto-Templating

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

Using kvell.config.js to generate templates

If you are not using the generate command, you can add a route/model in Kvell by updating the kvell.config.js too.

Note: Any updates in the kvell.config.js will reflect only when the server is running.

Routes

routes: Array<{ name: string, path: string }>

For adding a new route, open kvell.config.js and append a new Route (or multiple) object(s) to the routes array like so:

// kvell.config.js

routes: [
  {
    name: "admin",
    path: "/admin"
  }
]

If your server is not already running, run it with npm start.\

You will see a prompt confirming that there are some new route(s) detected, and asking for permission to create the template files for the same. You can choose to allow Kvell to add the files or add them by yourself.

Once the required files have been added, the server will start running normally.

Models

models: Array<string>

For adding a new model, open kvell.config.js and append a new Model (or multiple) name(s) to the models array like so:

// kvell.config.js

models: [
  "cart"
]

If your server is not already running, run it with npm start.\

You will see a prompt confirming that there are some new model(s) detected, and asking for permission to create the template files for the same. You can choose to allow Kvell to add the files or add them by yourself.

Once the required files have been added, the server will start running normally.

Last updated on 7/16/2020 by Neeraj Sharma
← Using generation scripts
  • Routes
  • Models
Kvell.js
Docs
Getting StartedGuidesDatabase Plugins
Social
kvell
Follow @nsharma1396
Copyright © 2020 Neeraj Sharma.