如何使用另一个端口在Visual Studio Code中调试无服务器脱机? [英] How to debug Serverless Offline in Visual Studio Code using another port?

查看:152
本文介绍了如何使用另一个端口在Visual Studio Code中调试无服务器脱机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个无服务器脱机服务器",我需要同时在本地运行.

I have two Serverless Offline "servers" which I need to run locally at same time.

因此,我需要更改其中一台服务器的端口.

So I need to change the port of one of the servers.

我使用Visual Studio Code调试器运行服务器.服务器的配置位于launch.json文件中.

I run a server using Visual Studio Code debugger. The configs of the servers are in launch.json files.

如何更改无服务器脱机应用程序的端口,以便可以使用VS Code调试器与另一个无服务器脱机应用程序并行运行?

How can I change the port of a Serverless Offline application so that I can run it in parallel with another Serverless Offline application using VS Code debugger?

推荐答案

通过在serverless.yml文件中添加以下几行来解决:

Solved by adding the following lines to the serverless.yml file:

custom:
    serverless-offline:   ## add this two lines
        port: 4000        ## bellow "custom:" line

这篇关于如何使用另一个端口在Visual Studio Code中调试无服务器脱机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆