node.js - 我想知道如何在 PM2 中使用 ngrok
问题描述
pm2 start ngrok http 5000 这是我输入的命令。但它并没有如我所愿。
请帮助我通过 PM2 使用 ngrok。
如果您使用 ngrk http 5000,您将可以使用它,直到终端关闭。它工作正常。
我想在 PM2 中使用它。
我的操作系统是 Window10 Node-Js。
谢谢你。
解决方案
下载/解压到同一个文件夹
然后运行以下
pm2 start pm2-ngrok.yaml
pm2-ngrok.yaml
apps:
- name : 'ngrok'
script: './ngrok'
args: 'http --hostname=YOURSUBDOMAINHERE.ngrok.io PORTHERE'
instances: '1'
autorestart: true
max_restarts: 10
max_memory_restart: '500M'
watch : false
error_file: 'err-prod.log'
out_file: 'out-prod.log'
log_file: 'combined-prod.log'
跑
pm2 startup
pm2 save
在重新启动后持续存在
推荐阅读
- python - 将多处理输出附加到 Python 中的数据框
- c# - 为什么 Npgsql 会反转 tsquery 数据?
- batch-processing - 7-Zip 通过批处理文件解压缩选定的文件
- ios - R.Swift - 无法调用非函数类型 StringResource 的值
- elasticsearch - 如何解决超集中的“elasticsearch 错误:‘字节’”?
- c++ - 为什么C++优化器在删除同一个指针时使用不同的delete
- javascript - 将函数内的值分配给全局变量(范围问题)
- angular - AWS 子域之一不起作用,带有 dev (dev.example.com) 的子域不起作用
- html - 此路由不支持 GET 方法。支持的方法:Laravel livewire 中的 POST
- ruby-on-rails - 刺激反射回调在生产中停止工作