Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Cosmos
CSL Incoming Webhook
Commits
370007e0
Commit
370007e0
authored
Sep 30, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/index.js
src/index.js
+5
-5
No files found.
src/index.js
View file @
370007e0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment