Skip to content

This repo is an answer for json-server's issue number 417

Notifications You must be signed in to change notification settings

Nilegfx/json-server-answer-417

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is a response for one of json-server questions

running the exampl

git clone https://github.com/Nilegfx/json-server-answer-417.git

cd json-server-answer-417

npm install

node server

make a request with basic authentication

from your command line, run

curl -u yourusername:yourpassword http://localhost:3000/posts

responses with status 200:

{
  "user": "yourusername",
  "body": [
    {
      "id": 1,
      "title": "first post title",
      "name": "ahmed ayoub"
    }
  ]
}

a request without basic authentication

from your command line, run

curl http://localhost:3000/posts

responses with status 401:

{
  "error": "unauthorized"
}

About

This repo is an answer for json-server's issue number 417

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published