A TodoList implemented with NodeJS and MongoDb (using mongoose).
Please, check if you have already installed all the needed stack.
- NodeJS;
- MongoDb;
- Postman (optional);
- A good text editor (your choice);
Using npm:
npm install
Using yarn:
yarn
Using npm:
npm run start
Using yarn:
yarn start
axios
.get("/tasks")
.then(response => {
console.log(response, "Tasks");
})
.catch(error => {
console.log(error, "Error");
});
const task = {
name: "Study NodeJS"
};
axios
.post("/tasks", task)
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
});
const task = {
name: "Study NodeJS",
id: 45678
};
const { id } = task;
axios
.put(`/tasks/${id}`, {
...task,
name: "Commit stuff"
})
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
});
const id = 54453;
axios
.delete(`/tasks/${id}`)
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
});
const id = 54453;
axios
.get(`/tasks/${id}`)
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
});
Not implemented yet :)