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
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