Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update module-admin readme #1787

Merged
merged 2 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/manage-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Use the steps below to add the **module-admin** tool to a reSolve application.
}
```

3. Register **module-admin** as a module the application's **run.js** file:
3. Register **module-admin** as a module in the application's **run.js** file:

```js
import resolveModuleAdmin from '@resolve-js/module-admin'
Expand Down
63 changes: 63 additions & 0 deletions packages/modules/module-admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,69 @@
[![npm version](https://badge.fury.io/js/@resolve-js/module-admin.svg)](https://badge.fury.io/js/@resolve-js/module-admin)
![Analytics](https://ga-beacon.appspot.com/UA-118635726-1/packages-@resolve-js/module-admin-readme?pixel)

Use this module to manage a reSolve application's sagas and read models.

## Installation

Use the steps below to add the **module-admin** tool to a reSolve application.

1. Install the [module-admin](https://github.com/reimagined/resolve/tree/master/packages/modules/module-admin/README.md) NPM package:

```bash
yarn add @resolve-js/module-admin
```

2. Register a script that runs the **module-admin** tool in the application's **package.json** file:

```js
"scripts": {
...
"module-admin": "module-admin",
...
}
```

3. Register **module-admin** as a module in the application's **run.js** file:

```js
import resolveModuleAdmin from '@resolve-js/module-admin'
...
switch (launchMode) {
case 'dev': {
const moduleAdmin = resolveModuleAdmin()
const resolveConfig = merge(
defaultResolveConfig,
appConfig,
devConfig,
moduleAdmin
)
}
case 'test:e2e': {
const moduleAdmin = resolveModuleAdmin()
const resolveConfig = merge(
defaultResolveConfig,
appConfig,
testFunctionalConfig,
moduleAdmin
)
}
}
```

## Usage

The **module-admin** tool adds API handlers to a reSolve application and sends queries to these handlers to manage the application. To use the tool, you need to start your application. Then, you can execute **module-admin** with the required command:

```bash
yarn module-admin read-models reset ShoppingList
```

The default URL that **module-admin** uses to access an application's API is `http://localhost:3000/api`. Use the `--api-url` option to specify another URL:

```bash
yarn module-admin --api-url "https://127.0.0.1:2000/api" read-models reset ShoppingList
```

## Manage Application

The `system` command manages the application's system.
Expand Down