Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Blank component to start a new one and add to elefrant framework.

Notifications You must be signed in to change notification settings

Elefrant/elefrant-blank-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elefrant Blank Component

Usage

Whiteboard component to create your own component.

Structure

Component /component.js

Main file of the component. Register the functionality for the different parts of the server.

module.exports = {
    // True if enabled component
    enable: true,

    // Name of component
    name: 'nameOfComponent',

    // Actions to do before Server creation
    beforeServer: function (elefrant) {
        // Actions and functions
    },

    // Actions to do after Server creation
    afterServer: function (elefrant, server) {
        // Actions and functions
    },

    // Variables to add when the server is creating
    paramServer: function (elefrant) {
        // Actions and functions
    },

    // Actions to do before create routes
    beforeRoute: function (elefrant) {
        // Actions and functions
    },

    // Actions to do after create routes
    afterRoute: function (elefrant) {
        // Actions and functions
    },

    // Variables to add when is creating each route
    paramRoute: function (route) {
        // Actions and functions
    },

    // Function to register to use in controllers or actions
    register: function (elefrant) {
        // Actions and functions
    }
};

Config /config/

Default config files for the component.

To allow users customize the config files, you should allow to create a file in general config folder. Will be easy to change. For example: elefrant/config/nameOfComponent.js

Lib /lib/

Create all the needed libraries.

Test /test/

Create test files

Launch tests

Just put in the console: npm test

License

MIT © Elefrant

About

Blank component to start a new one and add to elefrant framework.

Resources

Stars

Watchers

Forks

Packages

No packages published