← All Templates

REST API (Node)

TypeScriptIntermediateBackend

Production REST API with authentication, rate limiting, logging, and OpenAPI documentation.

Features

Code Preview

import Fastify from 'fastify';
import jwt from '@fastify/jwt';
import rateLimit from '@fastify/rate-limit';

const app = Fastify({ logger: true });
app.register(jwt, { secret: process.env.JWT_SECRET });
app.register(rateLimit, { max: 100, timeWindow: '1m' });

app.get('/api/v1/users', {
  preHandler: [app.authenticate],
}, async (req) => {
  return { users: [] };
});
Open in RoadCode

Related Templates

Express API
JavaScript · Beginner
Flask API
Python · Beginner
Django App
Python · Intermediate
FastAPI
Python · Intermediate