docs: add custom example for match text

This commit is contained in:
moonrailgun 2024-07-26 22:18:24 +08:00
parent 7542d88b5a
commit e4eee420ea

View File

@ -54,6 +54,27 @@ return res.data.pull_count;
replace `moonrailgun/tianji` to your own image name
### example for match text
```js
const start = Date.now();
const res = await request({
url: "https://example.com/"
});
const usage = Date.now() - start;
const matched = /maintain/.test(String(res.data));
if(matched) {
return -1;
}
return usage;
```
return `-1` means somthing wrong. in this case, its means in html body include `maintain` text.
### or more