Skip to content

vmontro/json-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON-SERVER

  1. Clona il progetto
  • Eseguire il codice
npm run start
  • Eseguire il codice in development con nodemon
npm run dev
  • Compilare .exe
npm run build




Esempi di cURL

NO TOKEN

  • GET
curl -X GET -H "Content-Type: application/json" http://localhost:3000/liste/
  • PATCH
curl -X PATCH -H "Content-Type: application/json" -d "{\"nome\": \"sia\", \"data\": \"01-07-2023\" }" http://localhost:3000/liste/1
  • POST
curl -X POST -H "Content-Type: application/json" -d "{\"nome\": \"sia\", \"data\": \"01-07-2023\" }" http://localhost:3000/liste/
  • DELETE
curl -X DELETE -H "Content-Type: application/json" http://localhost:3000/liste/



CON TOKEN

  • GET
curl -X GET -H "Authorization: Bearer IL_TUO_JWT" http://localhost:3000/liste/
  • PATCH
curl -X PATCH -H "Authorization: Bearer IL_TUO_JWT" -d "{\"nome\": \"sia\", \"data\": \"01-07-2023\" }" http://localhost:3000/liste/1
  • POST
curl -X POST -H "Authorization: Bearer IL_TUO_JWT" -d "{\"nome\": \"sia\", \"data\": \"01-07-2023\" }" http://localhost:3000/liste/
  • DELETE
curl -X DELETE -H "Authorization: Bearer IL_TUO_JWT" http://localhost:3000/liste/1




Configurazione docker

  • Esegui il codice di seguito per creare un bridge interno a docker
docker network create -d bridge --subnet=172.21.0.0/16 --gateway=172.21.0.1 json_server_bridge
  • Scarica il file docker-compose.yml ed esegui questo codice nel terminale
docker-compose up -d

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published