diff --git a/colors.js b/colors.js index 4f76c77..8fbde0e 100644 --- a/colors.js +++ b/colors.js @@ -115,6 +115,12 @@ function handleIdx(req, res) { } } + const headerItemList = [] + + for (const headerItem of Object.keys(req.headers).sort()) { + headerItemList.push(`${headerItem}:${req.headers[headerItem]}`); + } + const htmlFile = 'index.html'; res.statusCode = 200; res.setHeader("Content-Type", "text/html; charset=utf-8"); @@ -126,9 +132,12 @@ function handleIdx(req, res) { res.writeHead(404); res.write('Whoops! File not found!'); } else { + data = data.replace(/\$background_color/g, mycolor); data = data.replace(/\$font_color/g, font_color); data = data.replace(/\$hostname/g, hostname); + data = data.replace(/\$headers/g, headerItemList.join('\n')) + res.write(data); } res.end(); diff --git a/index.html b/index.html index 7475df0..3e426b4 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,17 @@ width: 100%; height: 100%; position: relative; - background-color: $background_color; + background-color: "$background_color"; + font-family: 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'; + } + + td:first-of-type { + white-space: nowrap; + } + + .highlight { + color: #7389ff; + font-size: 2em; } .center { @@ -35,24 +45,29 @@ font-family: "Trebuchet MS", Helvetica, sans-serif; text-align: center; } - - h1 { - font-size: 144px; - } - - p { - font-size: 64px; - } -
-

Hello Again!

-

$background_color app

-

$hostname

-
$font_color
-
+ + + + + + + + + + + + + + + + $headers +
+

Hello Again!

+
 
Coloring$background_color app
Hostname:$hostname
Font color$font_color
\ No newline at end of file