mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
DOCS: [GitBook] Code block caption (#1999)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
committed by
GitHub
parent
0051b41720
commit
45ad35e68a
@@ -30,17 +30,17 @@ require_glob("./domains/", false);
|
||||
One more important thing to note: `require_glob()` is as smart as `require()` is. It loads files always relative to the JavaScript
|
||||
file where it's being executed in. Let's go with an example, as it describes it better:
|
||||
|
||||
`dnscontrol.js`:
|
||||
|
||||
{% code title="dnsconfig.js" %}
|
||||
```javascript
|
||||
require("domains/index.js");
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
`domains/index.js`:
|
||||
|
||||
{% code title="domains/index.js" %}
|
||||
```javascript
|
||||
require_glob("./user1/");
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
This will now load files being present underneath `./domains/user1/` and **NOT** at below `./domains/`, as `require_glob()`
|
||||
is called in the subfolder `domains/`.
|
||||
|
Reference in New Issue
Block a user