File size: 2,802 Bytes
7db63d2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>API Documentation | SpeedyStack</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <link rel="stylesheet" href="style.css">
</head>
<body class="bg-gray-50 min-h-screen">
    <custom-navbar></custom-navbar>
    
    <main class="container mx-auto px-4 py-8">
        <h1 class="text-3xl font-bold text-gray-800 mb-6">API Documentation</h1>
        
        <div class="bg-white rounded-xl shadow-md overflow-hidden">
            <div class="p-6 border-b border-gray-200">
                <h2 class="text-xl font-semibold text-gray-800">RESTful Endpoints</h2>
                <p class="text-gray-600 mt-2">Available API endpoints for your fullstack application</p>
            </div>
            
            <div class="divide-y divide-gray-200">
                <!-- Users Endpoint -->
                <div class="p-6">
                    <div class="flex items-center mb-3">
                        <span class="inline-block px-2 py-1 bg-green-100 text-green-800 rounded-md text-sm font-medium mr-3">GET</span>
                        <code class="text-gray-800 font-mono">/api/users</code>
                    </div>
                    <p class="text-gray-600 mb-3">Retrieve all users</p>
                    <div class="bg-gray-100 p-4 rounded-md overflow-x-auto">
                        <pre class="text-sm text-gray-800">[
  {
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com",
    "createdAt": "2023-07-01T12:00:00Z"
  }
]</pre>
                    </div>
                </div>
                
                <!-- Posts Endpoint -->
                <div class="p-6">
                    <div class="flex items-center mb-3">
                        <span class="inline-block px-2 py-1 bg-blue-100 text-blue-800 rounded-md text-sm font-medium mr-3">GET</span>
                        <code class="text-gray-800 font-mono">/api/posts</code>
                    </div>
                    <p class="text-gray-600 mb-3">Retrieve all posts</p>
                    <div class="bg-gray-100 p-4 rounded-md overflow-x-auto">
                        <pre class="text-sm text-gray-800">[
  {
    "id": 1,
    "title": "First Post",
    "content": "This is a sample post content",
    "authorId": 1,
    "createdAt": "2023-07-01T12:00:00Z"
  }
]</pre>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <custom-footer></custom-footer>

    <script src="components/navbar.js"></script>
    <script src="components/footer.js"></script>
    <script>
        feather.replace();
    </script>
</body>
</html>