Here's how to start a static file server with pm2:
pm2 serve path port
pm2 serve . 9001
In this way, the static files in the current folder can be run, and the port number is 9001.
It also supports advanced use, as follows
pm2 serve . 9001 --name test --watch
This starts a static file server named test, port number 9001, and monitoring file changes
For other details of pm2, you can read this article https://blog.csdn.net/uikoo9/article/details/79018750