【发布时间】:2019-05-21 20:03:44
【问题描述】:
我有我的 node.js restify 服务器和带有静态资源的文件夹
const restify = require('restify')
let server = restify.createServer()
server.listen(8080, function () {
console.log('%s listening at %s', server.name, server.url)
});
server.get('/*', restify.plugins.serveStatic({
directory: __dirname + '/static',
default: 'index.html'
}));
我正在尝试了解如何使用 localhost:8080/index.html?token=123 等参数向 index.html 发出 get 请求
如果token有效,则返回index.html给客户端,否则返回错误
【问题讨论】:
标签: javascript node.js restify staticresource