serverless-offline
serverless-offline copied to clipboard
SLS_DEBUG doesn't show the exposed URL's in the console
Bug Report
Current Behavior
As per the documentation, I expect to see the URL's for direct POST calls when using SLS_DEBUG=* But i don't.
This is the console:
$ SLS_DEBUG=* serverless offline --stage dev
Running "serverless" from node_modules
Starting Offline at stage dev (us-east-1)
Offline [http for lambda] listening on http://localhost:3002
Function names exposed for local invocation by aws-sdk:
* function1: aws-node-project-dev-function1
When I run the command below, I will get the expected result from the lambda.
curl --request POST --url http://localhost:3002/2015-03-31/functions/aws-node-project-dev-function1/invocations
If I call the URL, I can use them, but I don't see them in the console. This is the starter code from serverless v3
Sample Code
- file: serverless.yml
service: aws-node-project
frameworkVersion: '3'
plugins:
- serverless-offline
provider:
name: aws
runtime: nodejs18.x
functions:
function1:
handler: index.handler
- file: handler.js
module.exports.handler = async (event) => {
return {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v3.0! Your function executed successfully!',
input: event,
}, null, 2),
};
};
Expected behavior/code
I expect to see these kinds of URLs in the console
* invokedHandler: myServiceName-dev-invokedHandler
[offline] Lambda Invocation Routes (for AWS SDK or AWS CLI):
* POST http://localhost:3002/2015-03-31/functions/myServiceName-dev-invokedHandler/invocations
[offline] Lambda Async Invocation Routes (for AWS SDK or AWS CLI):
* POST http://localhost:3002/2014-11-13/functions/myServiceName-dev-invokedHandler/invoke-async/
Environment
serverlessv3.27.0serverless-offlinev12.0.4node.jsv18.13.0OS: macOS 13.0.1 (22A400)
Additional context/Screenshots
This is reproducible by creating a new blank project using the serverless framework and trying to run the command.