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

404 error on home page with the 0.16 version using npx #1079

Comments

@kuncevic
Copy link

kuncevic commented Feb 20, 2020

Once switched to 0.16 version stated getting an 404 error in home page using npx:

npx json-server --watch db.json - 404 error when navigating the home page
npx [email protected] --watch db.json - no error

my db.json

{
  "video": [
   {
      "id": "hiOjK992bPU",
      "title": "LINDEMANN - Steh auf (Official Video)",
      "views": "8812123",
      "likes": "219234",
      "dislikes": "4389"
    },
    {
      "id": "NeQM1c-XCDc",
      "title": "Rammstein - Deutschland (Official Video)",
      "views": "88123123",
      "likes": "22543345",
      "dislikes": "75123"
    }
  ]
}
@oaydinyilmaz
Copy link

same issue on windows 10 with VS Code.

I'm able to see the objects but not dashboard(home page)

image

@typicode
Copy link
Owner

Thanks for the heads-up! It should be good now.

BigBlueHat pushed a commit to WileyLabs/json-server-contains that referenced this issue Mar 2, 2020
@JimiSweden
Copy link

JimiSweden commented Mar 2, 2020

I still have the problem of 404 on the home page, exactly as @oaydinyilmaz reported

using Yarn

node_modules\.bin\json-server -v
0.16.1

windows 10, 
node -v
v13.7.0

@myshov
Copy link

myshov commented Mar 10, 2020

@JimiSweden There is an issue if public directory already exists in your project. json-server attempts to serve index.html from there #1100 (comment)

@hhagay
Copy link

hhagay commented Jul 13, 2020

I am afraid this issue still exists.
Please Note:
json-server is version 0.16.1

@Rutvi27
Copy link

Rutvi27 commented Oct 21, 2021

I have the similar issue
Screenshot (174)

@MMG606
Copy link

MMG606 commented Oct 2, 2023

The same thing happened to me, I'm my case I wasn't specifying the db route which was in a folder named database,
for example:
json-server --watch db.json
should be
json-server --watch database/db.json

@Mohowk
Copy link

Mohowk commented Jun 18, 2024

Daaang now i have this too ! can anybody tell me how to solve it or what to do ? Please i feel so dumb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment