-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78e6903
commit 4c64dba
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"triggerId": "a82f0f1a7e584936a885b6fe325117f9", | ||
"triggerTypeCode": "APIG", | ||
"functionUrn": "urn:fss:cn-north-4:0bcc05efb100f2a92f53c011f262dfa0:function:default:fg-http-nodejs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范 | ||
name: component-test # 项目名称 | ||
access: huawei | ||
services: | ||
component-test: # 服务名称 | ||
component: xinwuyun/fg | ||
props: | ||
projectId: 0bcc05efb100f2a92f53c011f262dfa0 | ||
region: cn-north-4 | ||
function: | ||
functionName: fg-http-nodejs | ||
handler: index.handler | ||
memorySize: 128 | ||
timeout: 30 | ||
runtime: Node.js8.10 | ||
package: default | ||
codeType: zip | ||
code: | ||
codeUri: ./src | ||
trigger: | ||
triggerTypeCode: APIG | ||
eventTypeCode: APICreated | ||
status: ACTIVE | ||
eventData: | ||
group_id: 51ed66ba137d43afaf24c8281114ff4a | ||
env_name: Environment_rjmt | ||
env_id: a36de477aa3c4388b7bce759b32e0d8a | ||
auth: IAM | ||
protocol: HTTPS | ||
name: test | ||
path: /fg-http-nodejss | ||
match_mode: SWA | ||
req_method: GET | ||
backend_type: FUNCTION | ||
type: 1 | ||
sl_domain: 51ed66ba137d43afaf24c8281114ff4a.apig.cn-north-4.huaweicloudapis.com | ||
|
||
# interface APIGEventData { | ||
# groupId: string; | ||
# envId: string; | ||
# auth: string; | ||
# protocol: string; | ||
# name: string; | ||
# path: string; | ||
# matchMode: string; | ||
# reqMethod: string; | ||
# backendType: string; | ||
# type: number; | ||
# slDomain: string; | ||
# instanceId: string; | ||
# } |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const https = require('https'); | ||
let CONTEXT = null; | ||
exports.handler = function (event, context, callback) { | ||
CONTEXT = context; | ||
console.log('OPTIONS request, pass.'); | ||
const result = { | ||
body: 'Hello world, hello serverless.', | ||
headers: { | ||
"Content-Type":"application/json", | ||
"Access-Control-Allow-Origin": "*", | ||
"Access-Control-Allow-Headers": "Content-Type,Accept", | ||
"Access-Control-Allow-Methods": "GET" | ||
}, | ||
statusCode: 200, | ||
isBase64Encoded: false | ||
}; | ||
callback(null, result); | ||
return; | ||
} |