Questions tagged [json-server]

json-server expedites the creation of a REST API server, empowering you to serve JSON data in no time.

Is there a way to configure json-server, when utilized as a module, to introduce delays in its responses

json-server provides a convenient way to introduce delays in responses through the command line: json-server --port 4000 --delay 1000 db.json However, when attempting to achieve the same delayed response using json-server as a module, the following code ...

Is it possible to use a different key instead of 'id' for post and put requests when using json-server

I am currently utilizing a mock API for frontend testing purposes. After observing that an 'id' is necessary to insert or update data in the json-server package, I'm curious if it's possible to utilize an alternative key in place of 'id'. { id: 1, ---& ...

Guide to sending API requests from a React client to an Express server hosted on Heroku

I've been grappling with deploying a Twitch-like application using a combination of react, redux, node media server, and json server module to Heroku. One roadblock I keep hitting is when attempting to establish a connection between my react client an ...

The homepage on the JSON server is currently not visible

I recently set up a react-app using npx create-react-app, added json-server to my package.json file, and configured the necessary run script. "devDependencies": { "json-server": "0.14.2", "react-scripts": " ...

Error: Failed to convert value "NaN" to ObjectId for the "_id" field

[ Issue resolved... the solution turned out to be surprisingly simple... $scope.article = articleFactory.getArticles().get({id:parseInt($stateParams.id,10)}) .$promise.then( should have been: $scope.article = articleFactory.getArticles().get ...

Exploring the Connection with JSON-server

While creating a simulated API using json-server, I encountered an issue with passing a query. When utilizing _expand, I am able to display the parameters of a relationship, but it doesn't seem to work when the relationship is nested within a child. For i ...