Neither the CLI option --httpPort or the yaml setup below changes the http port - it keeps sticking to 3000.
Sample Code
service: my-service
plugins:
- serverless-webpack
- serverless-offline
provider:
name: aws
runtime: nodejs12.x
stage: dev
region: eu-west-1
functions:
hello:
handler: src/handler.default
events:
- http:
method: get
path: hello
integration: lambda
custom:
serverless-offline:
httpPort: 4000
webpack:
webpackConfig: 'config/serverless.webpack.config.js'
packager: 'yarn'
includeModules: true
Expected behavior/code
I expect that the port should change to 4000.
Environment
"serverless": "^1.63.0",
"serverless-offline": "^5.12.1",
"serverless-webpack": "^5.3.1",
hey @mattpocock with v5.x you have to use the port option. unfortunately the master README contains the documentation for the v6 release branch.
same problem here. I think the change has been done to correct the "port" option for dynamodb local plugin.
I tried several things but it doesn't seem to work:
$ sls offline --port 3001
offline: Starting Offline: prod/eu-central-1.
offline: Offline [http for lambda] listening on http://localhost:3002
$ sls offline --httpPort 3001
offline: Starting Offline: prod/eu-central-1.
offline: Offline [http for lambda] listening on http://localhost:3002
I tried both port and httpPort in serverless.yml, both nothing changed:
custom:
serverless-offline:
port: 3001
plugins:
- serverless-offline
I think upgraded everything (MacOs).
$ sls -v
Framework Core: 1.83.2
Plugin: 3.8.4
SDK: 2.3.2
Components: 2.34.9
````
"devDependencies": {
"serverless-dynamodb-local": "^0.2.39",
"serverless-offline": "^6.8.0"
}
```
ok, this works:
$ sls offline --lambdaPort 3001
offline: Starting Offline: prod/eu-central-1.
offline: Offline [http for lambda] listening on http://localhost:3001
serverless-offline:
httpPort: 4000
lambdaPort: 4002
Most helpful comment
hey @mattpocock with
v5.xyou have to use theportoption. unfortunately themasterREADME contains the documentation for thev6release branch.https://github.com/dherault/serverless-offline#important