OpenVeo server API for plugins

API Docs for: 3.0.0
Show:

Plugin

Defined in: lib/Plugin.js:9
Module: plugin

Summary

Each plugin which wants to be loaded by core must inherit from this class.

This Class must not be used directly, instead create a sub class.

Constructor

Plugin

Defined in lib/Plugin.js:9

Syntax

Plugin

()

Summary

Example:

// Example for implementing a new Plugin named "MyPlugin"

// MyPlugin.js

var openVeoAPI = require('@openveo/api');
function MyPlugin(){

  // Creates admin and front new routers
  this.router = express.Router();
  this.adminRouter = express.Router();
  this.webServiceRouter = express.Router();

  // Define routes directly here or in the configuration file

}

MyPlugin.prototype.start = function() {
  console.log('My plugin loaded');
};

module.exports = MyPlugin;
util.inherits(MyPlugin, openVeoAPI.Plugin);

Item Index

Methods

Methods

init

Defined in lib/Plugin.js:76

Syntax

init

(
  • callback
)
async

Summary

Offers the possibility to initialize the plugin.

A plugin may want, for example, to use this method to create indexes for its collections.

Parameters:

  • callback Function

    Function to call when it's done with :

    • Error An error if something went wrong, null otherwise

start

Defined in lib/Plugin.js:88

Syntax

start

(
  • callback
)
async

Summary

Indicates that the plugin is fully loaded in application process and can be started.

Parameters:

  • callback Function

    Function to call when it's done with :

    • Error An error if something went wrong, null otherwise

Properties

adminRouter

Defined in lib/Plugin.js:57

Syntax

adminRouter

Router

Summary

The plugin back end express router (all routes mounted on this router will require user authentication).

Default: null

router

Defined in lib/Plugin.js:48

Syntax

router

Router

Summary

The plugin public express router (all routes mounted on this router will be public).

Default: null

webServiceRouter

Defined in lib/Plugin.js:66

Syntax

webServiceRouter

Router

Summary

The plugin web service express router (all routes mounted on this router will require a web service authentication).

Default: null