astronode-plugin
v1.1.13
Published
Module with plugin interfaces and parsers to astronode
Downloads
9
Maintainers
Readme
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
DataMethods
interface. - You will need extends
DataAdapter
callingsuper
with the yourDataMethods
implementation for this ORM. - You will need implement a method
autoinitializate
in yourDataAdapter
to open database connection and setup.
Example: https://github.com/monumentum/astronode-mongoose-plugin
Contribuiting
// TODO