-
Notifications
You must be signed in to change notification settings - Fork 492
Allow splitting of config into multiple files #51
Description
From twitter:
@Nick_Craver with dnscontrol is there a recommended approach for a global.js (providers/vars) + a single .js file for each domain?
— Brandon Potter (@BrandonPotter) March 20, 2017
I agree this might be a useful feature. Currently the javascript is processed by the following process, using https://github.com/robertkrimen/otto as its javascript interpreter:
- Load and run the built in code from
helpers.js. - Load and run your user code from
dnsconfig.js. - Run a small script to jsonify and dump your config object to be read in go.
It may be possible to have some kind of built in mechanism for combining / importing other js files if your config is large and complicated.
Possibly require("otherfile.js") or import("otherfile.js"). It would simply act as string replacement, replacing the import statement with the contents of the specified file before running.
This is not a commitment to implement this, only a place for discussion. Please state cases for or against such a scheme.