![]() ![]()
What if you were lazy and did feel like refreshing or you didn’t know better? Well, we have to remove it manually from the todos state. If you refresh the page, the todo will be deleted. ![]() We call leteTodo and pass in the id of the todo we want to delete. It has a neutral sentiment in the developer community. It had no major release in the last 12 months. #TODOLIST APP USING MONGODB CODE#touch APIHelper.jsĬopy the following code into the APIHelper.js file import axios from "axios" const API_URL = " async function createTodo(task) Todolist-App-express-ejs-mongodb has a low active ecosystem. Let’s create the APIHelper.js file in the src directory of the todo-frontend. Since the frontend for this application is pretty straight forward, we are going to make changes to two files: App.js and the APIHelper.js (we will have to create) #TODOLIST APP USING MONGODB INSTALL#run npm install cors in the todo-backend directory, and then add the snippet below to the top of your index.js file in the root of todo-backend directoryĬonst cors = require("cors") app.use(cors()) Almost There :) In other words, without enabling cors on the backend, even Axios will not able to send our request to the API.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |