| Request | Endpoint | Details | Example Source |
|---|---|---|---|
GET | http://127.0.0.1:5000/todos | Get All | API |
GET | http://127.0.0.1:5000/todos/todo_id | Get Single Id | API |
POST | http://127.0.0.1:5000/todos | Insert One | API |
PUT | http://127.0.0.1:5000/todos/todo_id | Update One | API |
DELETE | http://127.0.0.1:5000/todos/todo_id | Delete One | API |
In Api File Define all routes
apiUrl = "http://127.0.0.1:5000/api/v1/"; todos = apiUrl + "todos"; todos() { return { getOne: ({id}) => axios.get(todos + `/${id}`), //url, id getAll: () => axios.get(todos), //url create: (data) => axios.post(todos, data), //url, data update: (toUpdate) => axios.put(toUpdate), delete: ({ id }) => axios.delete(`${id}`) } } ```js api.todos().getAll()