mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
Merge pull request #6033 from erik-krogh/serverlessLib
Approved by asgerf
This commit is contained in:
@@ -3,3 +3,5 @@
|
||||
| tst3/function/index.js:1:36:1:40 | event |
|
||||
| tst4/app.js:1:36:1:40 | event |
|
||||
| tst5/app.js:1:36:1:40 | event |
|
||||
| tst6/handler.js:6:23:6:36 | req.query.name |
|
||||
| tst7/handler.js:1:34:1:38 | event |
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
const serverless = require("serverless-http");
|
||||
const express = require("express");
|
||||
const app = express();
|
||||
|
||||
app.get("/", (req, res, next) => {
|
||||
res.send("Hello " + req.query.name);
|
||||
});
|
||||
|
||||
module.exports.handler = serverless(app);
|
||||
@@ -0,0 +1,16 @@
|
||||
service: aws-node-express-api
|
||||
|
||||
frameworkVersion: '2'
|
||||
|
||||
provider:
|
||||
name: aws
|
||||
runtime: nodejs12.x
|
||||
lambdaHashingVersion: '20201221'
|
||||
|
||||
functions:
|
||||
api:
|
||||
handler: handler.handler
|
||||
events:
|
||||
- http:
|
||||
path: /
|
||||
method: ANY
|
||||
@@ -0,0 +1,4 @@
|
||||
export async function myFunction(event, context, callback) {
|
||||
const body = JSON.parse(event.body);
|
||||
// do something
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
service: serverless-myChecker
|
||||
|
||||
plugins:
|
||||
- serverless-webpack
|
||||
- serverless-offline
|
||||
|
||||
custom:
|
||||
webpack:
|
||||
webpackConfig: ./webpack.config.js
|
||||
includeModules: true
|
||||
|
||||
provider:
|
||||
name: aws
|
||||
runtime: nodejs12.x
|
||||
profile: personal
|
||||
region: eu-west-1
|
||||
|
||||
functions:
|
||||
myChecker:
|
||||
handler: handler.myFunction
|
||||
events:
|
||||
- http:
|
||||
path: webhook
|
||||
method: post
|
||||
Reference in New Issue
Block a user