From 69be24b443f63f167195810792b8dfb70bdfb0ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 12 Apr 2022 18:13:18 +0200 Subject: [PATCH] Make the UI pages HTML 4 compliant MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/ui/httpd/start.ts | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/src/ui/httpd/start.ts b/src/ui/httpd/start.ts index 28396dfc..7ff8079a 100644 --- a/src/ui/httpd/start.ts +++ b/src/ui/httpd/start.ts @@ -1,31 +1,45 @@ import Bootstrap from '../../charging-station/Bootstrap'; import express from 'express'; +const pageHeader = ` + + + +`; +const pageFooter = ''; + const app = express(); app.get('/', (request, response) => { - response.send(` - -
- - -
- - `); + response.send( + pageHeader + + ` +
+ + +
+ ` + + pageFooter + ); }); app.get('/start', (request, response, next) => { Bootstrap.getInstance().start().catch(next); - console.log('*** started'); - response.send('Started
Return to Top'); + console.info('*** started'); + response.send( + pageHeader + 'Started
Return to Top' + pageFooter + ); }); app.get('/stop', (request, response, next) => { Bootstrap.getInstance().stop().catch(next); - console.log('*** stopped'); - response.send('Stopped
Return to Top'); + console.info('*** stopped'); + response.send( + pageHeader + 'Stopped
Return to Top' + pageFooter + ); }); app.listen(process.env.PORT ?? 8080, () => - console.log(`Listening on port: ${process.env.PORT ?? 8080}`) + console.info(`Listening on http://localhost:${process.env.PORT ?? 8080}`) ); -- 2.34.1