dherault / dherault/serverless-offline
SLS_DEBUG doesn't show the exposed URL's in the console
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 811
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
## 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
```yaml
service: aws-node-project
frameworkVersion: '3'
plugins:
- serverless-offline
provider:
name: aws
runtime: nodejs18.x
functions:
function1:
handler: index.handler
```
- file: handler.js
```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**
- `serverless` v3.27.0
- `serverless-offline` v12.0.4
- `node.js` v18.13.0
- `OS`: 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.
Contributor guide
Assessment
This issue has not been assessed yet.