Serving static files with restify

前端 未结 7 1597
时光说笑
时光说笑 2020-12-29 20:26

I am learning to use Node.js. Currently, I have a folder structure that looks like the following:

index.html
server.js
client
  index.html
  subs
    index.h         


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 20:49

    Try this : Here view is a static resource directory name

    server.get('/\/.*/', restify.plugins.serveStatic({
    
        directory: __dirname + "/view/",
        default: './home.html' 
    
       })
    );
    

提交回复
热议问题