How do I build a REST API with Node.js?
Here's a quick guide to building a REST API with Express.js:
npm init -y
npm install express
const express = require('express');
const app = express();
app.use(express.json());
let items = [
{ id: 1, name: 'Item One' },
{ id: 2, name: 'Item Two' },
];
app.get('/api/items', (req, res) => {
res.json(items);
});
app.post('/api/items', (req, res) => {
const item = { id: items.length + 1, ...req.body };
items.push(item);
res.status(201).json(item);
});
app.listen(3000, () => console.log('Running on :3000'));
Create a polished AI chat interface similar to ChatGPT. Include: a sidebar with conversation history, a main chat area with message bubbles (user on right, assistant on left), a text input with send button at the bottom, markdown rendering in assistant messages with code blocks, typing indicator animation, and a model selector dropdown. Use the Gumroad design system with cream background, black borders, pill-shaped buttons. No shadows, no gradients.