Upgrade deps and add new relic for tracing and logs (#103)
* Upgrade deps and add new relic for tracing and logs * Added env variable * Readd bernard which was accidently removed
This commit is contained in:
@@ -127,6 +127,8 @@ Resources:
|
||||
Environment:
|
||||
- Name: ENVIRONMENT_NAME
|
||||
Value: !Ref EnvironmentName
|
||||
- Name: NEW_RELIC_APP_NAME
|
||||
Value: !Sub 'graphql-${EnvironmentName}'
|
||||
Secrets:
|
||||
- Name: 'DATABASE_URL'
|
||||
ValueFrom: !Sub 'arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${EnvironmentName}/graphql-api/DATABASE_URL'
|
||||
@@ -138,6 +140,8 @@ Resources:
|
||||
ValueFrom: !Sub 'arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${EnvironmentName}/INTERIORS_TOKEN'
|
||||
- Name: 'BERNARD_QUEUE_URL'
|
||||
ValueFrom: !Sub 'arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${EnvironmentName}/sqs/PHOTOWALL_BERNARD_TASKS_QUEUE_URL'
|
||||
- Name: 'NEW_RELIC_LICENSE_KEY'
|
||||
ValueFrom: !Sub 'arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/newrelic/LICENSE_KEY'
|
||||
# Send logs to CloudWatch Logs
|
||||
LogConfiguration:
|
||||
LogDriver: awslogs
|
||||
|
||||
@@ -12,6 +12,7 @@ services:
|
||||
ports:
|
||||
- '4000:4000'
|
||||
environment:
|
||||
- ENVIRONMENT_NAME=${ENVIRONMENT_NAME}
|
||||
- COGNITO_POOL_ID=eu-west-1_3O4VfvPn7
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- INTERIORS_TOKEN=${INTERIORS_TOKEN}
|
||||
@@ -21,6 +22,9 @@ services:
|
||||
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
|
||||
- NODE_ENV=development
|
||||
- BERNARD_QUEUE_URL=${BERNARD_QUEUE_URL}
|
||||
- NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY}
|
||||
- NEW_RELIC_APP_NAME=${NEW_RELIC_APP_NAME}
|
||||
# - DEBUG=knex:*
|
||||
|
||||
networks:
|
||||
default:
|
||||
|
||||
Generated
+7545
-10876
File diff suppressed because it is too large
Load Diff
+31
-29
@@ -17,44 +17,46 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.31.0",
|
||||
"@aws-sdk/client-sqs": "^3.36.1",
|
||||
"@aws-sdk/client-translate": "^3.36.1",
|
||||
"@aws-sdk/s3-request-presigner": "^3.31.0",
|
||||
"apollo-datasource": "^3.1.0",
|
||||
"apollo-datasource-rest": "^3.2.0",
|
||||
"apollo-server": "^3.3.0",
|
||||
"@aws-sdk/client-s3": "^3.49.0",
|
||||
"@aws-sdk/client-sqs": "^3.49.0",
|
||||
"@aws-sdk/client-translate": "^3.49.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.49.0",
|
||||
"@newrelic/apollo-server-plugin": "^1.2.0",
|
||||
"apollo-datasource": "^3.3.1",
|
||||
"apollo-datasource-rest": "^3.5.1",
|
||||
"apollo-server": "^3.6.2",
|
||||
"async-redis": "^2.0.0",
|
||||
"axios": "^0.21.1",
|
||||
"datasource-sql": "^1.5.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"graphql": "^15.5.1",
|
||||
"graphql-scalars": "^1.10.0",
|
||||
"axios": "^0.25.0",
|
||||
"datasource-sql": "^1.6.0",
|
||||
"dotenv": "^16.0.0",
|
||||
"graphql": "^16.3.0",
|
||||
"graphql-scalars": "^1.14.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"jwk-to-pem": "^2.0.5",
|
||||
"knex": "^0.95.12",
|
||||
"knex-stringcase": "^1.4.5",
|
||||
"nodemon": "^2.0.12",
|
||||
"pg": "^8.7.1",
|
||||
"knex": "^1.0.2",
|
||||
"knex-stringcase": "^1.4.6",
|
||||
"newrelic": "^8.7.1",
|
||||
"nodemon": "^2.0.15",
|
||||
"pg": "^8.7.3",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"prettier": "^2.3.2",
|
||||
"slug": "^5.1.0",
|
||||
"prettier": "^2.5.1",
|
||||
"slug": "^5.2.0",
|
||||
"stringcase": "^4.3.1",
|
||||
"ts-node": "^10.2.1",
|
||||
"typescript": "^4.4.2",
|
||||
"ts-node": "^10.4.0",
|
||||
"typescript": "^4.5.5",
|
||||
"util": "^0.12.4",
|
||||
"validator": "^13.6.0"
|
||||
"validator": "^13.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.24",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.3",
|
||||
"@typescript-eslint/parser": "^4.28.3",
|
||||
"eslint": "^7.30.0",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.10.2",
|
||||
"@typescript-eslint/parser": "^5.10.2",
|
||||
"eslint": "^8.8.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"jest": "^27.0.6",
|
||||
"testcontainers": "^7.12.2",
|
||||
"ts-jest": "^27.0.3"
|
||||
"jest": "^27.5.0",
|
||||
"testcontainers": "^8.2.0",
|
||||
"ts-jest": "^27.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,6 @@ const verifyToken = async (
|
||||
// Access token, check for scopes
|
||||
const accessClaim = claim as AccessTokenClaim;
|
||||
const who = accessClaim.username ?? accessClaim.client_id;
|
||||
console.debug(`accessClaim confirmed for ${who}`);
|
||||
return {
|
||||
userName: who,
|
||||
isValid: true,
|
||||
@@ -144,7 +143,6 @@ const verifyToken = async (
|
||||
};
|
||||
} else {
|
||||
const idClaim = claim as IdTokenClaim;
|
||||
console.debug(`idClaim confirmed for ${idClaim.email}`);
|
||||
return {
|
||||
userName: idClaim.email,
|
||||
isValid: true,
|
||||
@@ -153,6 +151,7 @@ const verifyToken = async (
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('ERROR: Access denied');
|
||||
return {
|
||||
userName: '',
|
||||
error: error.message,
|
||||
|
||||
+7
-1
@@ -1,3 +1,4 @@
|
||||
require('newrelic');
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
|
||||
@@ -20,6 +21,7 @@ import { readFileSync } from 'fs';
|
||||
import { InteriorsLambdaAPI } from './datasources/interiors-lambda-api';
|
||||
import { TextsAPI } from './datasources/texts-api';
|
||||
import { PrintProductDefaultsAPI } from './datasources/printproduct-defaults-api';
|
||||
const newRelicPlugin = require('@newrelic/apollo-server-plugin');
|
||||
|
||||
const path = require('path');
|
||||
const typeDefs = readFileSync(
|
||||
@@ -94,10 +96,14 @@ async function main() {
|
||||
dataSources,
|
||||
context,
|
||||
introspection: true,
|
||||
plugins: [newRelicPlugin],
|
||||
});
|
||||
|
||||
await server.listen();
|
||||
|
||||
console.log('Server is running on http://localhost:4000');
|
||||
console.log(
|
||||
'Server is running on http://localhost:4000, ',
|
||||
process.env.ENVIRONMENT_NAME,
|
||||
);
|
||||
}
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user