* Reads the dashboard index.html and injects the creation mode flag. * Returns the modified HTML or null if the file doesn't exist.
()
| 11 | * Returns the modified HTML or null if the file doesn't exist. |
| 12 | */ |
| 13 | function getCreationModeHtml(): string | null { |
| 14 | const indexPath = join(__dirname, '../dashboard/index.html'); |
| 15 | if (!existsSync(indexPath)) return null; |
| 16 | let html = readFileSync(indexPath, 'utf-8'); |
| 17 | const creationScript = `<script>window.__AWEL_CREATION_MODE__=true</script>`; |
| 18 | if (html.includes('</head>')) { |
| 19 | html = html.replace('</head>', `${creationScript}</head>`); |
| 20 | } else { |
| 21 | html = creationScript + html; |
| 22 | } |
| 23 | return html; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Creates proxy middleware that forwards requests to the target app |
no outgoing calls
no test coverage detected