Post request not working
below is my db.json file
{
"feedback": [
{
"id": "1",
"rating": 10,
"text": "This is feedback item 1 coming from the backend"
},
{
"id": "2",
"rating": 8,
"text": "This is feedback item 2 coming from the backend"
}
]
}
I installed json-server in vs-code
get request is working in postman api application
But Getting this error for POST request
Error is
K-K-Harjeeth:feedback-app kk_harjeeth$ npm run server
> feedback-app@0.1.0 server
> json-server --watch db.json --port 6000
--watch/-w can be omitted, JSON Server 1+ watches for file changes by default
JSON Server started on PORT :6000
Press CTRL-C to stop
Watching db.json...
♡⸜(˶˃ ᵕ ˂˶)⸝♡
Index:
http://localhost:6000/
Static files:
Serving ./public directory if it exists
Endpoints:
http://localhost:6000/feedback
SyntaxError: Unexpected token r in JSON at position 0
at JSON.parse (<anonymous>)
at file:///Users/kk_harjeeth/feedback-app/node_modules/milliparsec/dist/index.js:21:45
at file:///Users/kk_harjeeth/feedback-app/node_modules/milliparsec/dist/index.js:8:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///Users/kk_harjeeth/feedback-app/node_modules/milliparsec/dist/index.js:21:20
at async file:///Users/kk_harjeeth/feedback-app/node_modules/@tinyhttp/app/dist/index.js:169:7
at async file:///Users/kk_harjeeth/feedback-app/node_modules/@tinyhttp/app/dist/index.js:434:7