Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support local file as JSON source #12

Open
adamhassel opened this issue Feb 8, 2022 · 1 comment
Open

Support local file as JSON source #12

adamhassel opened this issue Feb 8, 2022 · 1 comment

Comments

@adamhassel
Copy link

Is your feature request related to a problem? Please describe.

I'd love to be able to use a local file with JSON as the source. I'm generating the JSON myself anyways, and it seems overkill to have to spin up an http server to get a bunch of bytes sent, that might as well be a file on disk next to the module config, for example. I'll be updating the data in the json file indenpendently.

This would also be a great tool to test the module output without the need for constant request refreshes. There might be people using pay-per-request sources...

Describe the solution you'd like

I know that fetch doesn't support serving local files, but maybe make a new config directive, file or something, with that and url being mutually exclusive? Or have url support file://<path> and detect that in code?

Describe alternatives you've considered

Short of spinning up a webserver, I don't see an obvious alternative....

@DanielHabenicht
Copy link
Owner

It think I would go for the second alternative of adding a file Configuration option.

I don't have time for a least two weeks, but if you want to take a shot you can make a PR an I will review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants