api-route
Generate API route handlers for Express or Analog.js
npx skills add majiayu000/claude-skill-registry --skill api-route-donaldmurillo-momentum-cms --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Generate API Route Create API route handlers for either Express (Angular SSR) or Analog.js. ## Arguments - First argument: Framework - "express" or "analog" - Second argument: Route name (e.g., "health", "custom-endpoint") ## For Express (Angular SSR) Create handler in `apps/cms-admin/src/api/<route-name>.ts`: ```typescript import { Router, Request, Response } from 'express'; import type { CollectionConfig } from '@momentumcms/core'; export function create<PascalName>Routes(collections: CollectionConfig[]): Router { const router = Router(); router.get('/<route-name>', async (req: Request, res: Response) => { try { // Implementation res.json({ success: true }); } catch (error) { res.status(500).json({ error: 'Internal server error' }); } }); return router; } ``` Register in `apps/cms-admin/src/server.ts`: ```typescript import { create<PascalName>Routes } from './api/<route-name>'; app.use('/api', create<PascalName>Routes(collections)); ``` ## For Analog.js Create file-based route in `src/server/routes/api/<route-name>.get.ts`: ```typescript import { defineEventHandler, getQuery } from 'h3'; export default defineEventHandler(async (event) => { const query = getQuery(event); try { /
- Arguments
- For Express (Angular SSR)
- For Analog.js
- HTTP Method Suffixes (Analog.js)
- h3 Utilities
What does the api-route skill do?
Generate API route handlers for Express or Analog.js
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill api-route-donaldmurillo-momentum-cms --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
