和外部公司对接项目需要联调接口,大家不在一个局域网里ip:port无法访问。
直接部署生产环境又很不方便调测改bug,然后搜索到了很好用的内网服务器暴露到公网的方式。
因此记录一下
#localtunnel
步骤1. 安装npm (我之前有在本地起过前端项目所以有安装)
步骤2. 指定安装源来安装#localtunnel
npm install localtunnel -g --registry=https://registry.npm.taobao.org
步骤3. 调用命令来开启隧道服务
lt --port 端口号
然后就可以通过如下url访问局域网服务啦~
![](https://i-blog.csdnimg.cn/blog_migrate/ff6c8de7509fb1f5887fdeb1b4ee8b7d.png)
localtunnel: https://github.com/localtunnel/localtunnel