Skip to content

Commit 8699b07

Browse files
committedDec 1, 2023
feat: v1.0.3
1 parent 254151c commit 8699b07

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed
 

‎index.js

+14-15
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,22 @@ export default class ServerlessOfflineLambdaFunctionUrls {
3636
}
3737
getEvents(functions) {
3838
const stage = this.getStage()
39-
const verbs = this.configuration?.custom?.['serverless-offline']?.urlLambdaFunctionsHttpVerbs ?? [
40-
'GET',
41-
'POST'
42-
]
39+
const verbs = this.configuration?.custom?.['serverless-offline']?.urlLambdaFunctionsHttpVerbs ?? ['GET', 'POST']
4340
return Object.entries(functions).reduce((events, [functionKey, {handler}]) => {
4441
const path = `/${stage}/${encodeURIComponent(functionKey)}`
45-
return events.concat(verbs.map(v => ({
46-
functionKey,
47-
handler,
48-
http: {
49-
routeKey: `${verb} ${path}`,
50-
payload: '2.0',
51-
isHttpApi: true,
52-
path,
53-
method: verb
54-
}
55-
})))
42+
return events.concat(
43+
verbs.map(verb => ({
44+
functionKey,
45+
handler,
46+
http: {
47+
routeKey: `${verb} ${path}`,
48+
payload: '2.0',
49+
isHttpApi: true,
50+
path,
51+
method: verb,
52+
},
53+
}))
54+
)
5655
}, [])
5756
}
5857
getStage() {

‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-offline-lambda-function-urls",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"license": "ISC",
55
"description": "An extension off serverless-offline that adds support to lambda function urls",
66
"type": "module",
@@ -27,6 +27,7 @@
2727
"clean": "rm -rf node_modules 2>dev/null"
2828
},
2929
"peerDependencies": {
30+
"serverless": "3.x",
3031
"serverless-offline": ">= 12.x"
3132
},
3233
"keywords": [

‎pnpm-lock.yaml

+18-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)