1 import express from
'express';
3 import Bootstrap from
'../../charging-station/Bootstrap';
6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
7 "http://www.w3.org/TR/html4/strict.dtd">
11 const pageFooter
= '</html>';
13 const app
= express();
14 app
.disable('x-powered-by');
16 app
.get('/', (request
, response
) => {
21 <input type="button" onclick="window.location.href='/start';" value="Start" />
22 <input type="button" onclick="window.location.href='/stop';" value="Stop" />
29 app
.get('/start', (request
, response
, next
) => {
30 Bootstrap
.getInstance().start().catch(next
);
31 console
.info('*** started');
33 pageHeader
+ '<body><b>Started</b><br/><a href="/">Return to Top</a></body>' + pageFooter
37 app
.get('/stop', (request
, response
, next
) => {
38 Bootstrap
.getInstance().stop().catch(next
);
39 console
.info('*** stopped');
41 pageHeader
+ '<body><b>Stopped</b><br/><a href="/">Return to Top</a></body>' + pageFooter
45 app
.listen(process
.env
.PORT
?? 8080, () =>
46 console
.info(`Listening on http://localhost:${process.env.PORT ?? 8080}`)