|
| 1 | +export function getWelcomePageHtml(routes: { rpc: string; data: string; }) { |
| 2 | + return `<!DOCTYPE html> |
| 3 | +<html> |
| 4 | +<head> |
| 5 | + <title>ObjectQL Server</title> |
| 6 | + <style> |
| 7 | + body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; line-height: 1.6; color: #333; } |
| 8 | + h1 { margin-bottom: 10px; } |
| 9 | + code { background: #f4f4f4; padding: 2px 5px; border-radius: 3px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; } |
| 10 | + .card { border: 1px solid #e1e4e8; border-radius: 6px; padding: 24px; margin-top: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); } |
| 11 | + .status { color: #28a745; font-weight: 600; display: inline-flex; align-items: center; } |
| 12 | + .status::before { content: ""; display: inline-block; width: 10px; height: 10px; background: #28a745; border-radius: 50%; margin-right: 8px; } |
| 13 | + a { color: #0366d6; text-decoration: none; } |
| 14 | + a:hover { text-decoration: underline; } |
| 15 | + ul { list-style-type: none; padding: 0; } |
| 16 | + li { padding: 8px 0; border-bottom: 1px solid #f1f1f1; } |
| 17 | + li:last-child { border-bottom: none; } |
| 18 | + </style> |
| 19 | +</head> |
| 20 | +<body> |
| 21 | + <div style="margin-bottom: 20px;"> |
| 22 | + <span class="status">Running</span> |
| 23 | + </div> |
| 24 | + <h1>ObjectQL Server</h1> |
| 25 | + <p>The server is operational and ready to accept requests.</p> |
| 26 | + |
| 27 | + <div class="card"> |
| 28 | + <h3 style="margin-top: 0">API Endpoints</h3> |
| 29 | + <ul> |
| 30 | + <li><strong>JSON-RPC:</strong> <code>POST ${routes.rpc}</code></li> |
| 31 | + <li><strong>REST API:</strong> <code>GET ${routes.data}/:object</code></li> |
| 32 | + <li><strong>OpenAPI Spec:</strong> <a href="/openapi.json">/openapi.json</a></li> |
| 33 | + </ul> |
| 34 | + </div> |
| 35 | +
|
| 36 | + <div class="card"> |
| 37 | + <h3 style="margin-top: 0">Useful Links</h3> |
| 38 | + <ul> |
| 39 | + <li><a href="https://objectql.org/docs" target="_blank">Documentation</a></li> |
| 40 | + <li><a href="https://github.com/objectql/objectql" target="_blank">GitHub Repository</a></li> |
| 41 | + </ul> |
| 42 | + </div> |
| 43 | + |
| 44 | + <p style="margin-top: 40px; color: #666; font-size: 0.85em; text-align: center;"> |
| 45 | + Powered by <strong>ObjectQL</strong> |
| 46 | + </p> |
| 47 | +</body> |
| 48 | +</html>`; |
| 49 | +} |
0 commit comments