X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fui%2Fhttpd%2Fstart.ts;h=116b91741a9732232c9ba13a711b60b06cca6e34;hb=8114d10e3893e96bb725ce2fca9744429ee4b75b;hp=28396dfcc9181a4ad0a8cbcf01ab6ce430ff1ba3;hpb=903becc3931c3c84d91eb1ce1ecc2f5e3237607b;p=e-mobility-charging-stations-simulator.git diff --git a/src/ui/httpd/start.ts b/src/ui/httpd/start.ts index 28396dfc..116b9174 100644 --- a/src/ui/httpd/start.ts +++ b/src/ui/httpd/start.ts @@ -1,31 +1,47 @@ -import Bootstrap from '../../charging-station/Bootstrap'; import express from 'express'; -const app = express(); +import Bootstrap from '../../charging-station/Bootstrap'; -app.get('/', (request, response) => { - response.send(` +const pageHeader = ` + + + +`; +const pageFooter = ''; -
- - -
+const app = express(); +app.disable('x-powered-by'); - `); +app.get('/', (request, response) => { + 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}`) );