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