read helperREserve offers a method to read configuration files.
function read (filename: string): Promise<Configuration>
Types definition for
read
The configuration must comply with the properties and mappings documented here.
The extend property enables the chaining of configuration files to foster reusability, like in the following example.
{
"extend": "./mappings.json",
"port": 5000
}
Example of a configuration file extending another one
{
"mappings": [{
"match": "^/private/",
"status": 403
}, {
"match": "^/(.*)",
"file": "./$1"
}, {
"status": 404
}]
}
mappings.jsonconfiguration file