From 9e1b17e0fbcc7a4f48fab95f8bed9c03dfd2ef3d Mon Sep 17 00:00:00 2001 From: douglas Date: Tue, 4 Sep 2018 19:46:02 +1000 Subject: [PATCH] #30 - Updated aws endpoints. --- backend/serverless.yml | 31 +++++++------------ .../awsLambdaRidesApis.js} | 10 +++--- 2 files changed, 17 insertions(+), 24 deletions(-) rename backend/src/main/{controller/awsLambdaApis.js => rides/awsLambdaRidesApis.js} (60%) diff --git a/backend/serverless.yml b/backend/serverless.yml index c164d29e..491ccd13 100644 --- a/backend/serverless.yml +++ b/backend/serverless.yml @@ -26,16 +26,16 @@ provider: functions: auth: - handler: auth/auth.auth + handler: src/main/auth/auth.auth cors: true currentTime: - handler: utils/ping.endpoint + handler: src/main/utils/ping.endpoint events: - http: path: ping method: get loggedin: - handler: auth/loggedin.loggedin + handler: src/main/auth/loggedin.loggedin events: - http: path: authcheck @@ -43,7 +43,7 @@ functions: authorizer: auth cors: true create: - handler: rides/create.create + handler: src/main/rides/awsLambdaRidesApis.create events: - http: path: rides @@ -51,7 +51,7 @@ functions: cors: true update: - handler: rides/update.update + handler: src/main/rides/awsLambdaRidesApis.update events: - http: path: rides/{id} @@ -63,7 +63,7 @@ functions: id: true list: - handler: rides/list.list + handler: src/main/rides/awsLambdaRidesApis.list # runtime: nodejs8.10 events: - http: @@ -72,7 +72,7 @@ functions: cors: true findone: - handler: rides/findone.findone + handler: src/main/rides/awsLambdaRidesApis.findOne events: - http: path: rides/{id} @@ -82,18 +82,11 @@ functions: parameters: paths: id: true - maps: - handler: map/maps.maps - events: - - http: - path: map - method: get - cors: true - notify: - handler: notify - events: - - schedule: rate(2 hours) - - schedule: cron(0 12 * * ? *) +# notify: +# handler: notify +# events: +# - schedule: rate(2 hours) +# - schedule: cron(0 12 * * ? *) resources: Resources: GatewayResponse: diff --git a/backend/src/main/controller/awsLambdaApis.js b/backend/src/main/rides/awsLambdaRidesApis.js similarity index 60% rename from backend/src/main/controller/awsLambdaApis.js rename to backend/src/main/rides/awsLambdaRidesApis.js index e05c7be2..e7a2d0fe 100644 --- a/backend/src/main/controller/awsLambdaApis.js +++ b/backend/src/main/rides/awsLambdaRidesApis.js @@ -1,8 +1,8 @@ -const CreateRideService = require('../rides/CreateRideService'); -const ListRidesService = require('../rides/ListRidesService'); -const FindOneRideService = require('../rides/FindOneRideService'); +const CreateRideService = require('./CreateRideService'); +const ListRidesService = require('./ListRidesService'); +const FindOneRideService = require('./FindOneRideService'); const DatabaseManager = require('../database/DatabaseManager'); -const AwsLambdaRideApis = require('../rides/aws/AwsLambdaRideApis'); +const AwsLambdaRideApis = require('./aws/AwsLambdaRideApis'); const databaseManager = new DatabaseManager(); const createRideService = new CreateRideService(databaseManager); @@ -12,5 +12,5 @@ const findOneRideService = new FindOneRideService(databaseManager); const rides = new AwsLambdaRideApis(createRideService, listRidesService, findOneRideService); module.exports = { - rides: rides + ...rides }; \ No newline at end of file