robb-j / gruber

(WIP) A standards-based JavaScript server library & patterns
0 stars 0 forks source link

Configuration — accept relative URLs #6

Open robb-j opened 5 months ago

robb-j commented 5 months ago

The Configuration interface could also capture the current working directory (maybe as a URL?) so then config.url could take relative URLs. This would make it useful for capturing file paths using the file: protocol as well as external urls like https: or postgres:.

There would need to be a workingDirectory addition to ConfigurationOptions to initially capture the directory. Then like number and boolean (#3), it could try to create the URL with that value as the second constructor parameter to be passed to the Structure

robb-j commented 3 months ago

It might be clearer to have a new type like Structure.file to delineate between file: and other urls