Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
// the following is a workaround:
// Cloud Storage library tries to write in /home/ when uploading a buffer
process.env.HOME = '/tmp';
// Stackdriver APM
const traceApi = require('@google-cloud/trace-agent').start();
require('@google-cloud/debug-agent').start({allowExpressions: true});
require('@google-cloud/profiler').start();
const bodyParser = require('body-parser');
const express = require('express');
const puppeteer = require('puppeteer');
const Storage = require('@google-cloud/storage');
const logger = require('./logger');
const storage = new Storage();
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
// Ignore Favicon
app.use((req, res, next) => {
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
'use strict';
// [START profiler_setup_nodejs_app_engine]
require('@google-cloud/profiler').start();
// [END profiler_setup_nodejs_app_engine]
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
'use strict';
// [START profiler_setup_nodejs_compute_engine]
require('@google-cloud/profiler').start({
serviceContext: {
service: 'your-service',
version: '1.0.0'
}
});
// [END profiler_setup_nodejs_compute_engine]
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* eslint no-console: "off" */
const traceApi = require('@google-cloud/trace-agent').start({
serviceContext: {
service: 'image-diff'
}
});
const Storage = require('@google-cloud/storage');
const debug = require('@google-cloud/debug-agent').start();
require('@google-cloud/profiler').start();
const diff = require('./diff');
const storage = new Storage();
/**
* Generic background Cloud Function to be triggered by Cloud Storage.
*
* @param {object} event The Cloud Functions event.
* @param {function} callback The callback function.
*/
exports.imageDiff = (event, callback) => {
const debugReady = debug.isReady();
debugReady.then(() => {
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
require('@google-cloud/profiler').start({
serviceContext: {
service: 'paymentservice',
version: '1.0.0'
}
});
require('@google-cloud/trace-agent').start();
require('@google-cloud/debug-agent').start({
serviceContext: {
service: 'paymentservice',
version: 'VERSION'
}
})
const HipsterShopServer = require('./server');
const PORT = process.env['PORT'];
* Copyright 2018 Google LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('@google-cloud/profiler').start({
serviceContext: {
service: 'currencyservice',
version: '1.0.0'
}
});
require('@google-cloud/debug-agent').start({
serviceContext: {
service: 'currencyservice',
version: 'VERSION'
}
});
const opentelemetry = require('@opentelemetry/api');
const {NodeTracerProvider} = require('@opentelemetry/node');
const {BatchSpanProcessor} = require('@opentelemetry/tracing');
const {TraceExporter} = require('@google-cloud/opentelemetry-cloud-trace-exporter');