devlearn-apis

Guide building client-server APIs with REST, JSON, and fetch calls.

1|Updated May 24, 2026
One-click install
npx skills add https://github.com/mrdulasolutions/DevLearn --skill devlearn-apis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: devlearn-apis
Source: https://github.com/mrdulasolutions/DevLearn/tree/main/devlearn-apis
Command: npx skills add https://github.com/mrdulasolutions/DevLearn --skill devlearn-apis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

DevLearn API skill solves the confusion of “making data move” by teaching the full request/response mental model across client fetch, server routes, JSON payloads, environment variables, errors, and browser CORS behavior.

Core Features & Use Cases

  • Persistence ladder guidance: Helps choose between localStorage, REST APIs, or auth based on whether data is per-user, shareable, or private.
  • End-to-end API wiring: Explains endpoint design, server route handling, client fetch calls, and how JSON parsing/serialization fits the workflow.
  • Practical hardening: Covers .env patterns, status-code meaning, user-visible error handling, CORS decision-making, and auth-layer previews.

Quick Start

Ask the AI: Teach me how to add an endpoint and connect a client-side fetch call for a /api/todos feature in my current stack, including the JSON shape, .env usage, and what to do if I hit CORS.

Frequently Asked Questions about devlearn-apis

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

FAQPage Schema
How do I connect a client-side fetch call to a REST API endpoint?

To connect a client-side fetch call to a REST API, you design server routes to handle requests and use fetch on the client to send JSON payloads and parse the response data. This covers the full request and response flow.

Why does my REST API fetch call fail with a CORS error?

A CORS error occurs when the browser blocks a cross-origin REST API request. You resolve it by configuring CORS headers on the server route to explicitly allow the client domain to access the JSON endpoints.

When should I use a REST API instead of localStorage for data persistence?

Use a REST API instead of localStorage when data must be shared across users or protected by auth. localStorage only stores local browser data, while REST APIs handle server-side persistence and user-specific private data.

What is the best way to manage environment variables for API routes?

Managing environment variables for API routes involves using `.env` files to securely store configuration data like database URLs and auth secrets. The server loads these `.env` variables to protect sensitive information.

How do I handle 404 and 500 status codes in my fetch requests?

Handling 404 and 500 status codes in fetch requests requires checking the response status object and validating error conditions. You map these status codes to user-visible error messages to troubleshoot API issues effectively.

How do I add a login auth layer to my existing REST API?

Adding a login auth layer to a REST API involves selecting an auth ladder and implementing protected server routes. Clients must send auth credentials via fetch to receive a token before accessing private JSON data.