Learn about APIs
APIs connect systems over HTTP. Learn how to host an API, schedule jobs and keep real-time connections open.
Featured
- How-to guidesHow to host an APIHosting an API means running its HTTP server around the clock at a public address with HTTPS. Step-by-step with Node.js and Python, testing and common errors.
- How-to guidesHow to host a Node.js appTo host a Node.js app, prepare package.json, read the port and secrets from the environment, pick an LTS version and run it with node. Step-by-step guide.
- How-to guidesHow to host a FastAPI, Flask or Django appTo host a FastAPI, Flask or Django app, run it with a production server (Uvicorn or Gunicorn) on 0.0.0.0. Commands, Django settings and common errors included.
Concepts4
- What is a cron job? Syntax and examplesA cron job is a task that runs on its own at times set by a five-field expression. Learn the syntax, examples, common mistakes and how to schedule jobs in Node.js.
- What is a REST API?A REST API exposes resources at URLs and lets you act on them with HTTP methods like GET and POST. Learn the rules, status codes and a working example.
- What is a WebSocket and how does it work?A WebSocket is a protocol that keeps one connection open between client and server, with messages in both directions. See the handshake, code and when to use it.
- What is a webhookA webhook is an HTTP request a service sends to your URL when an event happens. Learn how it works, how to verify the signature, plus a Node.js example.
How-to guides8
- How to host an APIHosting an API means running its HTTP server around the clock at a public address with HTTPS. Step-by-step with Node.js and Python, testing and common errors.
- How to host a Node.js appTo host a Node.js app, prepare package.json, read the port and secrets from the environment, pick an LTS version and run it with node. Step-by-step guide.
- How to host a FastAPI, Flask or Django appTo host a FastAPI, Flask or Django app, run it with a production server (Uvicorn or Gunicorn) on 0.0.0.0. Commands, Django settings and common errors included.
- How to host a Python app or scriptTo host a Python app or script, pin the version, isolate dependencies in a venv, read secrets from the environment and handle SIGTERM. Step-by-step guide.
- Production checklist for your APIA production checklist for your API: environment variables, health check, graceful shutdown, standard errors, authentication, rate limiting, CORS and logs.
- How to host a Java (Spring) or .NET APITo host a Java (Spring Boot) or .NET API, build the artifact (JAR or DLL), read the port from the environment and listen on 0.0.0.0. Step-by-step guide with code.
- How to host a WebSocket serverTo host a WebSocket server, keep the process always on, pass the Upgrade header through your proxy, send pings, and plan for what happens with several instances.
- API rate limiting: what it is and how to add itAPI rate limiting caps how many requests a client can send in a time window. Learn the algorithms, add it to a Node.js API, return 429 and test it with curl.
Comparisons3
- Cron jobs vs background workers vs queuesCron runs tasks on a clock, a worker is a process that does work in the background, and a queue holds jobs until a worker takes them. Learn when to use each.
- WebSocket vs webhook vs SSEWebSocket is a two-way channel, SSE a stream from server to browser and a webhook an HTTP notice between servers. Compare them and choose, with code examples.
- API gateway vs load balancerA load balancer spreads traffic across copies of the same app. An API gateway is the front door that authenticates, limits and routes calls. Learn when to use each.