Commit 370007e0 authored by Ray Walker's avatar Ray Walker
Browse files

Merge branch 'fix/improve-testing' into 'develop'

Fixed App Responses to pass tests

See merge request !11
parents 529e7749 5c38f705
Pipeline #27490 passed with stages
in 8 minutes and 41 seconds
......@@ -7,6 +7,10 @@ const appVersion = '2.1.0';
const COSMOS_API_VERSION = 'v1';
if (typeof process.env.ENVIRONMENT === 'undefined') {
throw new Error('ENVIRONMENT is not defined');
}
if (process.env.ENVIRONMENT.match(/^prod(?:uction)?$/)) {
require('@google-cloud/trace-agent').start();
}
......@@ -15,10 +19,6 @@ if (typeof process.env.ENTITY === 'undefined') {
throw new Error('ENTITY is not defined');
}
if (typeof process.env.ENVIRONMENT === 'undefined') {
throw new Error('ENVIRONMENT is not defined');
}
if (typeof process.env.PROJECT === 'undefined') {
throw new Error('PROJECT is not defined');
}
......@@ -258,6 +258,7 @@ app.post('/', async function (req, res, _next) {
// NIGHTLY_READ
if (path === 'data' && action === 'full_table_exported') {
return await publishOne(TOPIC_NIGHTLY, req, res);
// return res.status(200).send({status: 'OK'});
}
// INCREMENTAL_READ
......@@ -268,7 +269,6 @@ app.post('/', async function (req, res, _next) {
// REALTIME_READ
await publishRealtime(TOPIC_REALTIME, req, res);
// return res.status(200).send({status: 'OK'});
});
// Root requests to this endpoint
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment