Questions tagged [json-server]

json-server allows you to rapidly create a REST API server that delivers JSON data.

json-server is a tool written in that allows you to rapidly create a server that when started up, delivers json data via a API.

You can use json-server for rapid prototyping and mocking out other REST API services.

Supply a JSON file to describes the JSON data and the API that will deliver it and json-server will start up a server that provides that data via a REST API

Source Code and further documentation https://github.com/typicode/json-server

Installation npm install json-server

Egghead Video (free) Nodejs: Creating demo apis with json-server

477 questions
0
votes
1 answer

What does response.status -1 mean?

I am working on Angular $resource and json-server.. when I turn my server off, I get -1 instead of 404 console.log($scope.message + ', response.status: ' + response.status + ', response.statusText: ' + response.statusText ); and my console say:…
shireef khatab
  • 977
  • 2
  • 13
  • 33
0
votes
0 answers

How do I do a POST request to this JSON?

Hi I have this fake mockup api and want to post to it, but keep getting 404 Not Found and by the way I'm using JSON-server to serve the API file locally & Postman to do the crud requests. Besides GET, I can't seem to POST nor UPDATE or DELETE. Here…
Khpalwalk
  • 989
  • 1
  • 6
  • 11
-1
votes
1 answer

how to get data from array in json file to table using react js

I need to link shipment numbers to the driver and display the data in the table Note that I am using json server Table
-1
votes
3 answers

access to a propery of json data in json server for sending data

i have json server fake data in my react app and here is my data: {"quotes": [ { "id": 1, "quote": "Javascript is my life", "author": "ali pasha", "comments": [], }, { "id": 2, "quote": "Learning react is very fun", "author": "nasim…
ali pasha
  • 168
  • 1
  • 2
  • 9
-1
votes
1 answer

How to implement JSON-Serever in NestJS Application?

I am new to Nest JS Framework and I dont whether I can use json-server to mock external API. I have already checked NestJS documentation but its not having any example. I found one question on Stack-overflow but it not complete Example Json-server…
Akki
  • 1,718
  • 2
  • 29
  • 53
-1
votes
1 answer

Identical HTTP GET has status 200 on first request but 304 after that

I'm confused with Status Code 304 "The HTTP 304 Not Modified client redirection response code indicates that there is no need to retransmit the requested resources", what does retransmit the requested resources refers to? Context: I'm using JSON…
Locke
  • 33
  • 8
-1
votes
1 answer

Getting data from JSON-Server to local JQuery

Local HTML and JSON-Server data. Getting the data from JSON-Server and using it in JQuery. Resolved with help of Kevin B and Sirko. Leaving the JS (JQuery) so it can be coppied in the future. var i = 0; var output; $("#send").click(function(e) { …
-1
votes
1 answer

Property '' does not exist on type 'never'. (useState on mapped JSON server data using Typescript)

I am following a react tutorial on mui and decided to incorporate typescript for reference: Net ninja MUI Notes.tsx fetched JSON server data then set it to notes import React, { useEffect, useState } from 'react'; const Notes = () => { const…
Knuckles
  • 13
  • 4
-1
votes
1 answer

Why does graphql not accept the parameters that I pass in the query?

I'm doing a practice with this library https://www.npmjs.com/package/json-graphql-server, I'm just trying to have the correct queries to be able to make a crud from the frontend but I don't understand how to add a new post since it does not accept…
Gerardo Guevara
  • 293
  • 1
  • 12
-1
votes
1 answer

why page reload when posting or updating and item using fake rest api with json server

I'm using Json-Server for mocking API requests, when fetching the post/ update the page reloads in each time which i do not know why, i searched for it and cant find any solution for that, NB: i am following a javascript Tuturial and it didnt…
-1
votes
1 answer

How to get data with json file

I want to get "results" into "page:1" with json server url because my code wants just "results" data, how can I do it? Here is my json file { "page": 1, "results": [ { "title": "Mortal Kombat" } ], "total_pages": 438, "total_results":…
-1
votes
1 answer

How can I delete the data from a json server in Reactjs

Link of the JSON data https://jsoneditoronline.org/#left=cloud.e09cb2f612284a47a28c71a2c813da80 How can I delete subjectname from JSON data my code is here http://localhost:3003/CourseList is my local JSON server const deleteSub = async id => { …
-1
votes
1 answer

How to update an object using axios and json server in a react hooks project

I am using a dialog box in a table to edit a row with axios.patch request. While clicking the edit button the values of that particular row are rendered into the TextFields which are in Dialog box but I'm unable to update the values. can anyone help…
-1
votes
2 answers

Accessing objects inside json with json-server

I have the following db.json { "cases":{ "TotalCount":1, "StartingPageNumber":1, "Data":[ { "Id":1, "CaseNumber":"1234", "CaseDescription":"Descpp something", …
Jeff Benister
  • 468
  • 3
  • 12
-1
votes
1 answer

How to let iphone connect json server API for debug?

I have try to use json server to call my API sample. In simulator, I use this code to call API successfully. //json-server -w db.json var request = try self.buildRequestNew(requestHeader: requestHeader, from: route) let testUrl =…
JimmyLee
  • 507
  • 2
  • 7
  • 24
1 2 3
31
32