(title: string, message: string)
| 39 | } |
| 40 | |
| 41 | function renderCallbackPage(title: string, message: string): string { |
| 42 | return `<!doctype html> |
| 43 | <html lang="en"> |
| 44 | <head> |
| 45 | <meta charset="utf-8"> |
| 46 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 47 | <title>${title}</title> |
| 48 | <style> |
| 49 | body { |
| 50 | margin: 0; |
| 51 | font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; |
| 52 | background: #f5f7fb; |
| 53 | color: #111827; |
| 54 | display: grid; |
| 55 | place-items: center; |
| 56 | min-height: 100vh; |
| 57 | padding: 24px; |
| 58 | } |
| 59 | main { |
| 60 | width: 100%; |
| 61 | max-width: 460px; |
| 62 | background: white; |
| 63 | border: 1px solid #e5e7eb; |
| 64 | border-radius: 16px; |
| 65 | padding: 28px; |
| 66 | box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08); |
| 67 | } |
| 68 | h1 { margin: 0 0 10px; font-size: 24px; } |
| 69 | p { margin: 0; color: #4b5563; line-height: 1.5; } |
| 70 | </style> |
| 71 | </head> |
| 72 | <body> |
| 73 | <main> |
| 74 | <h1>${title}</h1> |
| 75 | <p>${message}</p> |
| 76 | </main> |
| 77 | </body> |
| 78 | </html>`; |
| 79 | } |
| 80 | |
| 81 | function readRequestBody(req: IncomingMessage): Promise<string> { |
| 82 | return new Promise((resolve, reject) => { |
no outgoing calls
no test coverage detected