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
Adding a middleware from CLI does not work #1481
Comments
Hi, I had a similar issue with a different flag, you could try using v0 instead of v1 |
Update: It is working! @kvnloughead Thank you for your reply but it is still not working with me! |
@Nermeen-M what were the issues? |
@Nermeen-M how did you resolve this issue? |
@mkamakshi hey, so I did solve the issue, so the thing is that json-server is at version "alpha", so what you need to do is uninstall it and install it at an older version. cause the version 1.0^ of json-server doesn't have middleware implementations. |
@mkamakshi uninstall json server then install it again with version 0 |
I'm trying to add a middleware using CLI as follows:
json-server --watch data.json --middlewares api.js
But it doesn't work and this error appears:
TypeError [ERR_PARSE_ARGS_UNKNOWN_OPTION]: Unknown option '--middlewares'. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- "--middlewares"
How to fix this error?
The text was updated successfully, but these errors were encountered: