This repository has been archived by the owner on Jul 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Showing
17 changed files
with
212 additions
and
35 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
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
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
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
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
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
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
1 change: 1 addition & 0 deletions
1
packages/serverless-midway-plugin/test/aggregation/.serverless_plugins/test/index.js
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 @@ | ||
module.exports = require('../../../../dist'); |
7 changes: 7 additions & 0 deletions
7
packages/serverless-midway-plugin/test/aggregation/package.json
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,7 @@ | ||
{ | ||
"dependencies": { | ||
"@midwayjs/runtime-engine": "*", | ||
"@midwayjs/serverless-fc-starter": "*", | ||
"@midwayjs/faas": "*" | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/serverless-midway-plugin/test/aggregation/serverless.yml
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,34 @@ | ||
service: serverless-midway-test | ||
|
||
provider: | ||
name: aliyun | ||
|
||
functions: | ||
index: | ||
handler: index.handler | ||
events: | ||
- http: | ||
path: '/' | ||
method: get | ||
hello: | ||
handler: hello.handler | ||
events: | ||
- http: | ||
path: '/hello' | ||
method: get | ||
|
||
plugins: | ||
- test | ||
|
||
aggregation: | ||
index: | ||
handler: aggregation.handler | ||
functions: | ||
- index | ||
- hello | ||
|
||
package: | ||
include: | ||
exclude: | ||
excludeDevDependencies: false | ||
artifact: my-artifact.zip |
13 changes: 13 additions & 0 deletions
13
packages/serverless-midway-plugin/test/aggregation/src/hello.ts
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,13 @@ | ||
import { FaaSContext, func, inject, provide } from '@midwayjs/faas'; | ||
|
||
@provide() | ||
@func('hello.handler') | ||
export class HelloService { | ||
|
||
@inject() | ||
ctx: FaaSContext; // context | ||
|
||
async handler(event, obj = {}) { | ||
return 'hello.handler'; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/serverless-midway-plugin/test/aggregation/src/index.ts
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,13 @@ | ||
import { FaaSContext, func, inject, provide } from '@midwayjs/faas'; | ||
|
||
@provide() | ||
@func('index.handler') | ||
export class HelloService { | ||
|
||
@inject() | ||
ctx: FaaSContext; // context | ||
|
||
async handler(event, obj = {}) { | ||
return 'index.handler'; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/serverless-midway-plugin/test/aggregation/test/deploy.test.ts
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,7 @@ | ||
import * as assert from 'assert'; | ||
|
||
describe('/test/deploy/test/deploy.test.ts', () => { | ||
it('deploy result', async () => { | ||
assert(true); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
packages/serverless-midway-plugin/test/aggregation/tsconfig.json
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,22 @@ | ||
{ | ||
"compileOnSave": true, | ||
"compilerOptions": { | ||
"target": "ES2018", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"inlineSourceMap":true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"stripInternal": true, | ||
"pretty": true, | ||
"declaration": true, | ||
"outDir": "dist" | ||
}, | ||
"exclude": [ | ||
"dist", | ||
"node_modules", | ||
"test" | ||
] | ||
} |
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
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
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