1 import Bootstrap from
'../../charging-station/Bootstrap';
2 import express from
'express';
6 app
.get('/', (request
, response
) => {
11 <input type="button" onclick="window.location.href='/start';" value="Start" />
12 <input type="button" onclick="window.location.href='/stop';" value="Stop" />
18 app
.get('/start', (request
, response
, next
) => {
19 Bootstrap
.getInstance().start().catch(next
);
20 console
.log('*** started');
21 response
.send('<b>Started</b><br/><a href="/">Return to Top</a>');
24 app
.get('/stop', (request
, response
, next
) => {
25 Bootstrap
.getInstance().stop().catch(next
);
26 console
.log('*** stopped');
27 response
.send('<b>Stopped</b><br/><a href="/">Return to Top</a>');
30 app
.listen(process
.env
.PORT
?? 8080, () =>
31 console
.log(`Listening on port: ${process.env.PORT ?? 8080}`)