Skip to content

Commit

Permalink
[openmctStaticServer] Fix processLogging telemetry subscription not sent
Browse files Browse the repository at this point in the history
- The dictionary file was retrieved through an http request, and no route
  function was added through `app.get` on the server side to "evaluate" the
  file (evaluate template literals through `evalTemplateLiteralInJSON`) prior
  sending it. As a result, the template literal defining the "value" was not
  expanded.
  • Loading branch information
nunoguedelha committed Sep 14, 2022
1 parent af3d412 commit 0b48ccf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openmctStaticServer/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Import main configuration and dynamic dictionaries
confServers = require('../conf/servers');
dictionaryIcubtelemetry = require('./plugins/conf/dictionaryIcubTelemetry');
dictionaryProcessLogging = require('./plugins/conf/dictionaryProcessLogging');

// Send the process PID back to the parent through the IPC channel
const OpenMctServerHandlerChildProc = require('./openMctServerHandlerChildProc');
Expand All @@ -21,6 +22,7 @@ const {
const confServersJSON = evalTemplateLiteralInJSON(confServers);
const expandedDictionaryIcubtelemetry = expandTelemetryDictionary(dictionaryIcubtelemetry);
const dictionaryIcubtelemetryJSON = evalTemplateLiteralInJSON(expandedDictionaryIcubtelemetry);
const dictionaryProcessLoggingJSON = evalTemplateLiteralInJSON(dictionaryProcessLogging);
const app = require('express')();
expressWs(app);

Expand All @@ -32,6 +34,9 @@ app.get('/config/confServers.json', function(req, res){
app.get('/plugins/conf/dictionaryIcubTelemetry.json', function(req, res){
res.send(dictionaryIcubtelemetryJSON);
});
app.get('/plugins/conf/dictionaryProcessLogging.json', function(req, res){
res.send(dictionaryProcessLoggingJSON);
});

// Route static server
app.use('/', staticServer);
Expand Down

0 comments on commit 0b48ccf

Please sign in to comment.