mirror of
https://github.com/tauri-apps/actions-netlify.git
synced 2026-01-31 00:45:22 +01:00
ci: add functions-dir operational test (#206)
This commit is contained in:
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@@ -24,6 +24,7 @@ jobs:
|
||||
production-branch: master
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
deploy-message: "Deploy from GitHub Actions"
|
||||
functions-dir: './functions-test'
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
|
||||
11
functions-test/hello.js
Normal file
11
functions-test/hello.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// NOTE: This is for operational test
|
||||
|
||||
// Go to https://hogehoge--nwtgck-actions-netlify.netlify.app/.netlify/functions/hello?name=John
|
||||
// (from: https://kentcdodds.com/blog/super-simple-start-to-serverless)
|
||||
exports.handler = async event => {
|
||||
const subject = event.queryStringParameters.name || 'World'
|
||||
return {
|
||||
statusCode: 200,
|
||||
body: `Hello ${subject}!`,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user