Skip to content

monumentum/astronode-plugin

Repository files navigation

Astronode Plugin

npm Build Status Coverage Status bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies bitHound Code

This is a simple package with some interfaces to create your on Engine and Data plugins to astronode :)

How to Use It

First of all you need to install the package inside you plugin npm install --save astronode-plugin

EngineAdapter

To create an Engine adapter you will import EngineAdapter from astronode-plugin. After it extends this class an override methods createRoute and start.

createRoute: Will be called everytime when astronode receive a route register request, it comes with the follow parameters: path, method, middlewares, callback
start: Method used to initializate the server.

Example: https://github.com/monumentum/astronode-express-plugin

DataAdapter & DataMethods

To crete an Data adapter you need first of all understand how it works, we had three parts in this process:

  • You need to map the five base methods from a CRUD (find, findById, create, update and delete) using DataMethods interface.
  • You will need extends DataAdapter calling super with the your DataMethods implementation for this ORM.
  • You will need implement a method autoinitializate in your DataAdapter to open database connection and setup.

Example: https://github.com/monumentum/astronode-mongoose-plugin

Contribuiting

// TODO

About

A simple package with some interfaces to create your on Engine and Data plugins to astronode :)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published