# Example: Adding a New "API Tester" Page This example demonstrates the complete process of adding a new page to CodeForge using the declarative system. ## Goal Add an "API Tester" page that allows users to test REST API endpoints. ## Step 1: Create the Component Create `src/components/ApiTester.tsx`: ```typescript import { useState } from 'react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { Textarea } from '@/components/ui/textarea' export function ApiTester() { const [method, setMethod] = useState('GET') const [url, setUrl] = useState('') const [response, setResponse] = useState('') const [loading, setLoading] = useState(false) const handleTest = async () => { setLoading(true) try { const res = await fetch(url, { method }) const data = await res.json() setResponse(JSON.stringify(data, null, 2)) } catch (error) { setResponse(`Error: ${error}`) } finally { setLoading(false) } } return (

API Tester

Test REST API endpoints and inspect responses

Request
setUrl(e.target.value)} className="flex-1" />
{response && ( Response