External field (#580)

* feat: add external endpoint

* add external to messagecontrol

---------

Co-authored-by: Carlos Valente <carlosvalente@pm.me>
This commit is contained in:
Alex Christoffer Rasmussen
2023-11-22 08:06:48 +01:00
committed by GitHub
parent c4886a617c
commit 797a0edf57
18 changed files with 229 additions and 49 deletions
+4
View File
@@ -33,6 +33,7 @@ import { populateStyles } from './modules/loadStyles.js';
import { eventStore, getInitialPayload } from './stores/EventStore.js';
import { PlaybackService } from './services/PlaybackService.js';
import { RestorePoint, restoreService } from './services/RestoreService.js';
import { messageService } from './services/message-service/MessageService.js';
console.log(`Starting Ontime version ${ONTIME_VERSION}`);
@@ -155,6 +156,9 @@ export const startServer = async () => {
const initialPayload = getInitialPayload();
eventStore.init(initialPayload);
// eventStore set is a dependency of the services that publish to it
messageService.init(eventStore.set.bind(eventStore));
expressServer.listen(serverPort, '0.0.0.0');
return { message: returnMessage, serverPort };