mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-05-08 22:08:27 +00:00
Updated What is rule file and how to write one (markdown)
parent
74b75cec49
commit
dd453b203f
@ -104,6 +104,17 @@ To invoke a rule file
|
||||
* in shell ``anyproxy --rule /path/to/ruleFile.js``
|
||||
|
||||
|
||||
To invoke a third-party node module in rule file
|
||||
-------------------------
|
||||
* ``` anyproxy install ``` is designed for quickly invoking third-party modules in rule file
|
||||
* for example, if you want to use *underscore* for supporting rules development, just use ``` anyproxy install underscore ```...
|
||||
* ... and require it in rule file
|
||||
|
||||
```
|
||||
var base = require("path").join(process.env.NODE_PATH,'anyproxy','node_modules');
|
||||
var underscore = require(path.join(base,'underscore'));
|
||||
```
|
||||
|
||||
Samples
|
||||
-------------------------
|
||||
* Samples could be found at [https://github.com/alibaba/anyproxy/tree/master/rule_sample](https://github.com/alibaba/anyproxy/tree/master/rule_sample).
|
Loading…
x
Reference in New Issue
Block a user