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();
14 app
.get('/', (request
, response
) => {
19 <input type="button" onclick="window.location.href='/start';" value="Start" />
20 <input type="button" onclick="window.location.href='/stop';" value="Stop" />
27 app
.get('/start', (request
, response
, next
) => {
28 Bootstrap
.getInstance().start().catch(next
);
29 console
.info('*** started');
31 pageHeader
+ '<body><b>Started</b><br/><a href="/">Return to Top</a></body>' + pageFooter
35 app
.get('/stop', (request
, response
, next
) => {
36 Bootstrap
.getInstance().stop().catch(next
);
37 console
.info('*** stopped');
39 pageHeader
+ '<body><b>Stopped</b><br/><a href="/">Return to Top</a></body>' + pageFooter
43 app
.listen(process
.env
.PORT
?? 8080, () =>
44 console
.info(`Listening on http://localhost:${process.env.PORT ?? 8080}`)