serving certs from the Academy

This commit is contained in:
Daniele Polencic
2020-04-09 11:09:48 +08:00
parent 312857fda5
commit 97f53d2122
5 changed files with 4469 additions and 96 deletions

1
.gitignore vendored
View File

@@ -13,3 +13,4 @@ _site/
.jekyll-metadata
.vscode/
backstop_data/
lambda/

16
functions/cert.js Normal file
View File

@@ -0,0 +1,16 @@
exports.handler = function(event, context, callback) {
const axios = require('axios')
axios
.get(`https://academy.learnk8s.io${event.path}`)
.then(response => {
callback(null, {
statusCode: 200,
body: response.data,
})
})
.catch(error => {
console.log('Error', error)
callback('Error')
})
}

View File

@@ -2,6 +2,7 @@
base = "."
publish = "_site"
command = "npm install && npm test && npm run fmt && npm run build"
functions = "lambda"
[context.deploy-preview]
command = "npm install && npm test && mkdir -p _site && echo -e \"\nDisallow: /\" >> _site/robots.txt && npm run fmt && npm run build"
[context.deploy-preview.environment]

4540
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,9 @@
"build": "ts-node --files --transpile-only src/index.tsx",
"fmt": "ts-node --files --transpile-only src/check.ts",
"test": "cross-env tsc --noEmit && ts-node --files node_modules/tape/bin/tape \"src/**/test.ts\" \"src/**/*.test.ts\" \"src/**/*.integration.ts\" \"src/**/integration.ts\"",
"start": "ts-node --files --transpile-only src/start.ts"
"start": "ts-node --files --transpile-only src/start.ts",
"lambda-serve": "netlify-lambda serve functions",
"lambda-build": "netlify-lambda build functions"
},
"author": "Learnk8s",
"license": "UNLICENSED",
@@ -48,6 +50,7 @@
"md5": "^2.2.1",
"mdast-util-to-string": "^1.0.6",
"mjml": "^4.5.1",
"netlify-lambda": "^1.6.3",
"opentype.js": "^1.1.0",
"postcss": "^7.0.14",
"prettier": "^1.19.1",