Skip to content

Fabio-Ottaviani-Dev/vue-axios-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue, Axios, Todos

A besic REST CRUD Todos App, made with: Vue & Axios

Dependencies

  1. Vue
  2. Axios
  3. lite-server
  4. JSON Server

Setup

# 1. Clone the project
# 2 cd into it
# 3 install the dependencies
npm install
# OR
npm install lite-server --save-dev
npm install json-server

Run it

# 1. Run lite-server
npx lite-server
# 2. Open another tab in the terminal (ctrl + shift + t)

# 3. Run json-server
json-server --port 5000 --watch db.json

How to test json-server endpoint with curl

# Create
curl -X POST -H "Content-Type: application/json" -d '{"name":"New todo stuff"}' http://localhost:5000/todos

# Read >> All
curl -X GET http://localhost:5000/todos

# Read >> id 1
curl -X GET http://localhost:5000/todos/1

# Update >> id 1
curl -X PATCH -H "Content-Type: application/json" -d '{"name":"Very New todo stuff"}' http://localhost:5000/todos/1

# Delete >> id 1
curl -X DELETE http://localhost:5000/todos/1

About

A besic REST CRUD Todos App, made with: Vue & Axios

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published