micro

Build asynchronous HTTP microservices and API endpoints with the micro framework.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill micro-aarnavbaddam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: micro
Source: https://github.com/AarnavBaddam/skills/tree/main/micro
Command: npx skills add https://github.com/AarnavBaddam/skills --skill micro-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing lightweight HTTP endpoints in Node.js often requires heavy frameworks with routing, middleware, and boilerplate. This Skill provides expert guidance for building single-purpose asynchronous HTTP microservices with Vercel's micro library using minimal code. ## Core Features & Use Cases - Request Body Parsing: Parse JSON, text, and raw buffer request bodies with the json(), text(), and buffer() helpers. - Response & Error Handling: Send responses with send() and throw proper HTTP errors with createError() for correct status codes. - Handler Composition: Wrap handlers with higher-order functions to add middleware-like behavior such as CORS headers. - Use Case: You need a small webhook receiver that parses a JSON payload and returns a 200 response. Use this Skill to write a single async handler, run it with npx micro, and develop with hot-reloading via micro-dev. ## Quick Start Ask the AI to create a micro HTTP endpoint that parses a JSON request body and returns a JSON response.

Frequently Asked Questions about micro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an HTTP endpoint with the micro framework?▼

Export an async function that receives the request and response objects, then return a value which micro sends as the response. Run it with npx micro after installing the package with npm install micro.

How do I parse a JSON request body in micro?▼

Use the json() helper exported by micro: const body = await json(req). For plain text use text(req), and for raw binary data use buffer(req). Body parsing is explicit and never automatic.

Does micro support routing for multiple endpoints?▼

No, micro is a single-endpoint server with no built-in routing. For multi-route services you need an external router such as micro-router, or a different framework entirely.

How do I return HTTP error status codes in micro?▼

Use createError(statusCode, message) and throw the result inside your handler, for example throw createError(401, 'Unauthorized'). Micro catches thrown errors and converts them into proper HTTP error responses.

How do I add middleware like CORS to a micro handler?▼

Wrap your handler with a higher-order function that modifies the request or response before calling the inner handler. For CORS, set the Access-Control-Allow-Origin header on the response and then delegate to the wrapped function.

What is micro-dev and when should I use it?▼

micro-dev is the development companion for micro that provides hot-reloading during local development. Install it as a dev dependency and run npx micro-dev index.js instead of the production micro command.