https://github.com/comby-tools/comby-mutation-server
https://github.com/comby-tools/comby-mutation-server
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/comby-tools/comby-mutation-server
- Owner: comby-tools
- License: apache-2.0
- Created: 2021-01-03T03:14:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-06T07:43:40.000Z (over 3 years ago)
- Last Synced: 2025-01-19T18:14:52.643Z (9 months ago)
- Language: JavaScript
- Size: 749 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# README
## Install
```
npm install express body-parser @iarna/toml minimist
```
## Server example### Add transformation rules
Put [comby config files](https://comby.dev/docs/configuration#toml-format) in `rules`. See examples there, which are used by default.
### Running the server
Start the server:
```bash
$ export NODE_OPTIONS="--max-old-space-size=8192"
$ node server.js
[+] Loaded 109 transformation rules
[+] Mutation server listening at http://:::4448
```**Parameters and defaults**
Flags that matter:
- `--port 5555` manually specify to listne on port `5555`. The default is `4448`.
- `--retries N` repicks a random mutation in the `rules` directory if the current one doesn't apply, up to `N` times.
- `--debug` prints out various debug info: source received, transformations picked and applied, etc.Other supported flags can be listed with `node server.js --help`.
**Testing and debugging**
Start the server: `node server.js --debug`. Then, a separate terminal:
```bash
curl -d '{1} {2} {3} [a] [b] (*) (&) (%, $)' -H "Content-Type: text/plain" -X POST http://localhost:4448/mutate
```Where `'...'` is taken as the source. Do this a couple of times until a rule can fire. See server output for debug messages.