Skip to content

Commit

Permalink
feat: cache stats api (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolam committed Jan 21, 2019
1 parent 1b5ca51 commit 328acd2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"dependencies": {
"all-contributors-cli": "^5.10.1",
"compromise": "^11.13.0",
"probot": "^8.0.0-octokit-16-preview"
"probot": "^8.0.0-octokit-16-preview",
"serverless-api-gateway-caching": "^1.2.2"
},
"devDependencies": {
"@tophat/eslint-config": "^0.1.4",
Expand Down
15 changes: 6 additions & 9 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ service: all-contributors-bot
frameworkVersion: '=1.35.1'

plugins:
- serverless-api-gateway-caching
- serverless-offline # must be last

custom:
apiGatewayCaching:
enabled: true
stage: ${opt:stage, self:provider.stage}
appId:
dev: '23544'
Expand All @@ -18,15 +21,6 @@ custom:
sentryDsn:
dev: ''
prod: 'https://[email protected]/1366866'
stageSettings:
CacheClusterEnabled: true
CacheClusterSize: '0.5'
MethodSettings:
- CachingEnabled: true
- HttpMethod: GET
ResourcePath: "/stats"
CachingEnabled: true
CacheTtlInSeconds: 3600

provider:
name: aws
Expand Down Expand Up @@ -59,3 +53,6 @@ functions:
path: /stats
method: get
cors: true
caching:
enabled: true
ttlInSeconds: 3600
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3669,6 +3669,10 @@ lodash.isboolean@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6"

lodash.isempty@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e"

lodash.isinteger@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343"
Expand Down Expand Up @@ -3717,6 +3721,10 @@ lodash.sortby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"

lodash.split@^4.4.0:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.split/-/lodash.split-4.4.2.tgz#a7f7bd9f37968b9312428e2f3ac3fb3173c4c3c6"

lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
Expand Down Expand Up @@ -5058,6 +5066,14 @@ [email protected]:
parseurl "~1.3.2"
send "0.16.2"

serverless-api-gateway-caching@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/serverless-api-gateway-caching/-/serverless-api-gateway-caching-1.2.2.tgz#45a59eb4c2c86ebea2082bd0930099d2c335f626"
dependencies:
lodash.get "^4.4.2"
lodash.isempty "^4.4.0"
lodash.split "^4.4.0"

serverless-offline@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/serverless-offline/-/serverless-offline-4.0.0.tgz#3ba9fe467ed6b7a0e4661160b2d7929bd5ca03df"
Expand Down

0 comments on commit 328acd2

Please sign in to comment.