We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
It could be very interesting to have the possibilites to have dynamic file import with the queried path:
Query: http://localhost:8000/articles/1
http://localhost:8000/articles/1
My mock file: /mocks/__/GET.mock
/mocks/__/GET.mock
HTTP/1.1 200 OK Content-Type: application/json #import `${request.url.split('/')[2]+".json"}`;
I try this:
module.exports = (() => { var fs = require('fs'); var obj = JSON.parse(fs.readFileSync("./"+request.url.split('/')[2]+".json", 'utf8')); return obj; })();
But relative path doesn't work, and i'm not fan to put an absolute path here, but it works
Do you have a solution ?
Thanks for all :-)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
It could be very interesting to have the possibilites to have dynamic file import with the queried path:
Query:
http://localhost:8000/articles/1
My mock file:
/mocks/__/GET.mock
I try this:
But relative path doesn't work, and i'm not fan to put an absolute path here, but it works
Do you have a solution ?
Thanks for all :-)
The text was updated successfully, but these errors were encountered: