pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2 serve : index.html as default file on subdirectories

Open ssavajols opened this issue 7 years ago • 7 comments

When accessing to a subdirectorie with no file specified, we don't get index.html file which is in the directory

/
expected
/index.html (currently OK)

/subdir/ => error is dir
expected
/subdir/index.html (currently not OK)

Supporting information

PM2 version: `pm2 -v` : 2.4.6
Node version: `node -v` : node-v6.10.2-linux-x64/

ssavajols avatar Jun 12 '17 08:06 ssavajols

Should be easy as appending /index.html if the path is a directory (here), if you can make a PR :)

vmarchaud avatar Jun 12 '17 08:06 vmarchaud

@ssavajols PR welcome, it's quite an easy fix

Unitech avatar Jun 26 '17 14:06 Unitech

I can see it's easy, but for my use I've replaced pm2 serve by npm module serve. So I don't need it now and I don't have time for now to do it. If I can in the next few weeks, I'll do it.

ssavajols avatar Jun 26 '17 14:06 ssavajols

Hi @Unitech,

I'd like to see the changes from @JackLLLLL in one of the next releases because #4220 doesn't fix this. See https://github.com/Unitech/pm2/pull/4196#issuecomment-704814484 for more information.

Thanks & bye Ralf

rwam avatar Oct 07 '20 09:10 rwam

Hi, I have the same problem trying to serve static output from a Nuxt 3 project. Any news?

marcotw avatar Oct 12 '23 09:10 marcotw

Any update on this? Issue for me too. I'm trying to serve my docs created using Docusaurus

piyushk96 avatar Oct 17 '23 10:10 piyushk96

same problem

jsupa avatar Dec 18 '23 13:12 jsupa