The Config Service is a microservice built using the Moleculer framework. It provides a centralized configuration management system, allowing you to store, retrieve, and manage configuration settings for your applications.
- Store and retrieve configuration settings
- Automatically load initial configurations
- RESTful API for managing configurations
- Supports NeDB as the database adapter
-
Clone the repository:
git clone <repository-url> cd config-service
-
Install dependencies:
npm install
-
Start the service:
npm run dev
-
Get Configuration
GET /v1/config/get/:key
Retrieve the value of a configuration setting by its key.
-
Set Configuration
POST /v1/config/set
Set the value of a configuration setting. If the key does not exist, it will be created.
Request Body:
{ "key": "your-key", "value": "your-value" } -
Get All Configurations
GET /v1/config/all
Retrieve all configuration settings.
You can define initial configuration settings in the service settings. These settings will be loaded when the service starts.
settings: {
config: {
"your-key": "your-value",
// ...other configurations...
}
}This project is licensed under the MIT License.