astronode-plugin v1.1.13
Astronode Plugin
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
DataMethodsinterface. - You will need extends
DataAdaptercallingsuperwith the yourDataMethodsimplementation for this ORM. - You will need implement a method
autoinitializatein yourDataAdapterto open database connection and setup.
Example: https://github.com/monumentum/astronode-mongoose-plugin
Contribuiting
// TODO