Node.js Express
Minimalist web framework for Node.js with TypeScript support.
🚀 Quick Start
import express, { Request, Response } from 'express';
const app = express();
app.use(express.json());
app.get('/api/users', (req: Request, res: Response) => {
res.json([{ id: 1, name: 'John' }]);
});
app.listen(3000, () => console.log('Server running on port 3000'));
📋 When to Use
- ✅ Building REST APIs on Node.js
- ✅ Need simple and flexible middleware setup
- ❌ Not for complex GraphQL servers (use Apollo)
🔧 Step-by-Step Instructions
- Initialize:
npm init -y - Install:
npm install express typescript @types/node - Create
tsconfig.jsonand server file - Run:
npx tsc && node dist/server.js
📦 Dependencies
npm install express typescript @types/express @types/node ts-node
🧪 Examples
Input: GET /api/users
Output: [{"id": 1, "name": "John"}]
🔗 Resources
✅ Validation
- Server starts without compilation errors
- Endpoints respond correctly
- JSON parsing works properly
Source: ssrjkk/claude-skills — distributed by TomeVault.