Serving static files with restify

前端 未结 7 1582
时光说笑
时光说笑 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:41

    I came across this issue just recently, so while this may not help you it could help others who are having trouble with it.

    When you declare Restify as const restify = require('restify');, the serveStatic method will be in the plugins object so using restify.serveStatic will quietly fail. The correct way to access the method is restify.plugins.serveStatic.

    You can find the update docs here: http://restify.com/docs/plugins-api/#serve-static

提交回复
热议问题