rest-api
Installation
SKILL.md
REST API
Representational State Transfer (REST) is the architectural style for distributed hypermedia systems. It relies on stateless, client-server, cacheable communications protocols (mostly HTTP).
When to Use
- Public APIs: The universal standard; easiest for 3rd parties to consume.
- Simple Resource Access: Perfect for CRUD (Create, Read, Update, Delete) operations.
- Caching: When you need to leverage HTTP caching (CDNs, Browsers).
Quick Start
// Express.js Example
app.get("/users/:id", async (req, res) => {
const user = await db.find(req.params.id);
if (!user) return res.status(404).json({ error: "Not Found" });