我正在使用 freeboard.io 构建干舷。我正在使用 express 在节点服务器上运行它。我用
router.get('/', function(req, res, next) {
res.sendFile(path.join(__dirname + '/index.html'));
});
在命中基本路线时发送干舷 html 文件。但是,为了让 freeboard 加载我保存的仪表板,我需要将 #source=dashboard.json 附加到 url。所以最终的网址看起来像
http://localhost:8080/#source=dashboard.json
有什么方法可以使用express来做到这一点吗?几乎当我点击 localhost:8080/ 时,我想附加到 url 路径 #source=dashboard.json 并使用 index.html 文件进行响应。谢谢!