import React, { useState } from 'react'; import { Copy, Check, Key, Code, Zap, Shield, Clock } from 'lucide-react'; export default function StubbrLanding() { const [email, setEmail] = useState(''); const [token, setToken] = useState(''); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [copied, setCopied] = useState(false); const requestToken = async () => { if (!email || !email.includes('@')) { setError('Please enter a valid email address'); return; } setLoading(true); setError(''); setToken(''); try { const response = await fetch('https://stubbr.dev/__token/request', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email }) }); const data = await response.json(); if (response.ok) { setToken(data.token); } else { setError(data.error || 'Something went wrong'); } } catch (err) { setError('Failed to connect. Please try again.'); } finally { setLoading(false); } }; const copyToken = () => { navigator.clipboard.writeText(token); setCopied(true); setTimeout(() => setCopied(false), 2000); }; const handleKeyPress = (e) => { if (e.key === 'Enter') { requestToken(); } }; return (
Mock API with Superpowers
A flexible mock API service that echoes your requests with dynamic fake data generation. Perfect for frontend development, testing, and rapid prototyping.
Instant Setup
Secure Tokens
40+ Placeholders
Rate Limited
One token per email • Free forever
Your API Token
{token}
{`curl -X POST https://stubbr.dev/api/users \\
-H "Authorization: Bearer YOUR_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{
"name": "?name",
"email": "?email",
"age": "?numberSmall"
}'`}
Response:
{`{
"name": "John Doe",
"email": "john.doe@example.com",
"age": 7
}`}
{item}
))}
Generate multiple items using{' '}
__repeat
Request:
{`{
"user": {
"__repeat": 3,
"id": "?counter",
"name": "?name",
"email": "?email"
}
}`}
Response:
{`{
"users": [
{
"id": 0,
"name": "John Doe",
"email": "john@example.com"
}
]
}`}
Control response behavior with{' '}
__instructions
{`{
"user": { "name": "?name" },
"__instructions": {
"delay": 2000,
"status": 201,
"headers": {
"X-Custom": "Value"
},
"body": {
"success": true
}
}
}`}
10
Requests per window
100KB
Max request size
5s
Max delay