Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
twitchyvr committed Nov 19, 2023
1 parent 869f16c commit d6d41c4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
const { Telemetry } = require('./telemetry');
const { Telemetry } = require('./telemetry')

module.exports = async function (context, req) {
try {
// Check if there is content in the request body
if (!req.rawBody) {
throw new Error('No file uploaded.');
throw new Error('No file uploaded.')
}

// The binary data of the .ibt file is contained in req.rawBody
const telemetryData = req.rawBody;
const telemetryData = req.rawBody

// Process telemetry
const telemetry = new Telemetry(telemetryData);
console.log(telemetry.header);
const telemetry = new Telemetry(telemetryData)
console.log(telemetry.header)

// Response
context.res = {
status: 200,
body: 'Telemetry data processed.'
};
}
} catch (error) {
context.res = {
status: 500,
body: `Error: ${error.message}`
};
}
}
};
}

0 comments on commit d6d41c4

Please sign in to comment.