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

Running "json-server --watch ./data/db.json --port 8000 --routes ./data/routes.json" results in the error "Unknown option '--routes'" #1512

Open
SteveGFortescue opened this issue Feb 6, 2024 · 5 comments

Comments

@SteveGFortescue
Copy link

SteveGFortescue commented Feb 6, 2024

I can't see this issue documented anywhere else and have tried different versions of json-server

Running on Apple M1 Pro
Node: 20.9.0
json-server: 1.0.0-alpha.23

Have tried running from npx, json-server as global as well as local and both.
running the following json-server --watch ./data/db.json --port 8000 --routes ./data/routes.json results in the error below

`npx json-server --watch ./data/db.json --port 8000 --routes ./data/routes.json

Unknown option '--routes'
Usage: json-server [options]

Options:
-p, --port Port (default: 3000)
-h, --host Host (default: localhost)
-s, --static

Static files directory (multiple allowed)
--help Show this message
--version Show version number`

The documentation says --routes is an option but the package in npm does not contain it?

image

@homj
Copy link

homj commented Feb 7, 2024

afaik this option is not available in 1.0.0
The documentation for --routes only refers to 0.x.x releases

@hamidmayeli
Copy link

Will this option be available in the final v1 version?

@leeyh20
Copy link

leeyh20 commented Feb 25, 2024

How else can we make API routes that are level 2 or deeper? For example /api/users ?

@SaimonL
Copy link

SaimonL commented Feb 27, 2024

I went back to older version

@Alejandroem
Copy link

It doesn't make sense to remove a feature after it's been out?

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

6 participants