Skip to content
AGenson edited this page Mar 4, 2018 · 11 revisions

moleculer-mysql-template

Moleculer template for creating a web api, with a remote MySQL database.

This template is based on moleculer, using:

This adapter overwrites the one from moleculer-db:

  • So less functionalities
  • But some are added (like multi-table management per service). For now the actions are very limited, but when understanding the adapter, you can change it to add your own features.

It is more an example of usage than a template, but you can :

  • Change as you want the tables' model
  • Create your own services (just be sure to keep the configuration described in Usage)
  • Change API routes to your own purpose

Features

  • Remote MySQL connection
  • Simple CRUD actions
  • Fields filtering
  • Multi-table management (one service can do operations on several tables of the database)
  • Formatting answers from requests ( Responses / Errors )

Install

# Clone repository
git clone https://github.com/AGenson/moleculer-mysql-template

# Install dependencies
npm install
Clone this wiki locally