From 22901286aee0acc78ccb44e8a7ec5ec01bac623f Mon Sep 17 00:00:00 2001 From: Brett Andrews Date: Fri, 21 Jun 2019 14:46:01 -0700 Subject: [PATCH] docs: move basic-starter logic into src directory --- __tests__/integration.js | 4 ++-- examples/alb/src/app.js | 1 - examples/basic-starter/README.md | 1 + examples/basic-starter/{ => src}/app.js | 2 +- examples/basic-starter/{ => src}/lambda.js | 0 examples/basic-starter/{ => src}/sam-logo.png | Bin examples/basic-starter/{ => src}/views/index.pug | 0 7 files changed, 4 insertions(+), 4 deletions(-) rename examples/basic-starter/{ => src}/app.js (97%) rename examples/basic-starter/{ => src}/lambda.js (100%) rename examples/basic-starter/{ => src}/sam-logo.png (100%) rename examples/basic-starter/{ => src}/views/index.pug (100%) diff --git a/__tests__/integration.js b/__tests__/integration.js index d25207aa..b121c822 100644 --- a/__tests__/integration.js +++ b/__tests__/integration.js @@ -2,7 +2,7 @@ const path = require('path') const fs = require('fs') const awsServerlessExpress = require('../index') const apiGatewayEvent = require('../examples/basic-starter/api-gateway-event.json') -const app = require('../examples/basic-starter/app') +const app = require('../examples/basic-starter/src/app') const serverlessExpress = awsServerlessExpress.configure({ app }) const server = serverlessExpress.server @@ -240,7 +240,7 @@ describe('integration tests', () => { delete response.multiValueHeaders.etag delete response.multiValueHeaders['last-modified'] - const samLogoPath = path.resolve(path.join(__dirname, '../examples/basic-starter/sam-logo.png')) + const samLogoPath = path.resolve(path.join(__dirname, '../examples/basic-starter/src/sam-logo.png')) const samLogoImage = fs.readFileSync(samLogoPath) const samLogoBase64 = Buffer.from(samLogoImage).toString('base64') diff --git a/examples/alb/src/app.js b/examples/alb/src/app.js index 2b64850a..0c0d0501 100644 --- a/examples/alb/src/app.js +++ b/examples/alb/src/app.js @@ -3,7 +3,6 @@ const express = require('express') const bodyParser = require('body-parser') const cors = require('cors') // const compression = require('compression') -// const { getCurrentLambdaInvoke } = require(process.env.NODE_ENV === 'test' ? '../..' : 'aws-serverless-express') const { getCurrentLambdaInvoke } = require('aws-serverless-express') const app = express() const router = express.Router() diff --git a/examples/basic-starter/README.md b/examples/basic-starter/README.md index 7c804df2..2af34b37 100644 --- a/examples/basic-starter/README.md +++ b/examples/basic-starter/README.md @@ -44,5 +44,6 @@ To update this example against the latest local changes to aws-serverless-expres ```bash npm pack ../.. npm install ./aws-serverless-express-3.3.5.tgz +npm install --prefix ./src ./ npm run local ``` \ No newline at end of file diff --git a/examples/basic-starter/app.js b/examples/basic-starter/src/app.js similarity index 97% rename from examples/basic-starter/app.js rename to examples/basic-starter/src/app.js index 4fa892f9..528f029c 100644 --- a/examples/basic-starter/app.js +++ b/examples/basic-starter/src/app.js @@ -3,7 +3,7 @@ const express = require('express') const bodyParser = require('body-parser') const cors = require('cors') const compression = require('compression') -const { getCurrentLambdaInvoke } = require(process.env.NODE_ENV === 'test' ? '../../index' : 'aws-serverless-express') +const { getCurrentLambdaInvoke } = require(process.env.NODE_ENV === 'test' ? '../../../index' : 'aws-serverless-express') const app = express() const router = express.Router() diff --git a/examples/basic-starter/lambda.js b/examples/basic-starter/src/lambda.js similarity index 100% rename from examples/basic-starter/lambda.js rename to examples/basic-starter/src/lambda.js diff --git a/examples/basic-starter/sam-logo.png b/examples/basic-starter/src/sam-logo.png similarity index 100% rename from examples/basic-starter/sam-logo.png rename to examples/basic-starter/src/sam-logo.png diff --git a/examples/basic-starter/views/index.pug b/examples/basic-starter/src/views/index.pug similarity index 100% rename from examples/basic-starter/views/index.pug rename to examples/basic-starter/src/views/index.pug