webpro / dyson

Node server for dynamic, fake JSON.
837 stars 62 forks source link

json file and js file in same folder causes problems #85

Closed danday74 closed 6 years ago

danday74 commented 6 years ago

When I put a JSON file called overview.json in a dyson folder and have a overview.js file (any file with the same name) dyson fails to pick up the .js file

I have used this pattern to load my .json into the .js file

See this example here ... https://github.com/danday74/mock-server/tree/master/rest/mock/me/get

Note that the code in the example works because the .json file has a different name to the .js file

Not sure if this will be something you plan to fix but I thought I'd raise an issue :)

webpro commented 6 years ago

Thanks, @danday74. Maybe you can open a PR to fix this? :-)

webpro commented 6 years ago

On second thought, I'm leaning against "fixing" this. I think it's not a bug, it's a feature: to load JSON files as configuration.

So my recommendation would be to put such templates outside the "dyson folder".

I hope you agree :-)