Tutorial "Local Library" website written in Node/Express.
🎉code → https://github.com/dupontdenis/library.git
http://localhost:3000/catalog/books
Tutorial "Local Library" website written in Node/Express.
🎉code → https://github.com/dupontdenis/library.git
→ https://dupontmongodb.blogspot.com/
mongodb →
https://github.com/dupontdenis/testMongo.git
https://github.com/dupontdenis/TESTMONGOOSE.git
https://github.com/dupontdenis/TESTCORSMONGO.git
💡 Les navigateurs ne supportent que GET et POST en natif dans les formulaires. Découvrez comment gérer DELETE et PUT.
Méthode CRUD | Support natif HTML | Solution avec Express |
Create (POST) | ✅ Oui | <form method="POST"> |
Read (GET) | ✅ Oui | <form method="GET"> |
Update (PUT) | ❌ Non | method-override + POST |
Delete (DELETE) | ❌ Non | method-override + POST |
/posts/:id/update and /posts/:id/delete). Those endpoints accept normal POST form submissions and return normal redirects or rendered pages.method-override is a middleware used to turn a POST into a PUT/DELETE on the server (usually by reading a hidden _method field or a query parameter).public/index.html and public/js/app.js) uses fetch() to perform CRUD operations.
🚀 https://mypizzasapi.onrender.com/
{
"message": "Welcome to Pizza API! 🍕",
"description": "A simple REST API for pizzas - inspired by ghibliapi.dev",
"endpoints": {
"pizzas": "/API/pizzas",
"pizzaById": "/API/pizzas/:id",
"pizzasWithPrices": "/API/pizzasWithPrices",
"ingredientPrices": "/API/ingredientPrices",
🪛"pizzaSearchByIngredient": "/API/pizzas/search?ingredient=🧀",
"pizzaSinglePrice": "/API/pizzasWithPrices/:id/price",
"customPrice": {
"method": "POST",
"path": "/API/pizzasWithPrices/compute",
"body": {
"ingredients": [
"🍅",
"🧀"
]
}
}
}
}Exemples :
🪛Ainsi pour tester l'API avec ingredient=🧀
https://mypizzasapi.onrender.com/API/pizzas/search?ingredient=🧀
🪛Ainsi pour tester l'API avec ingredient=🍅 et ingredient=🍄
https://mypizzasapi.onrender.com/API/pizzas/search?ingredient=🍄&ingredient=🍅
🥷Pour tester : https://dupontdenis.github.io/testMyPizzasAPI/