javascript - Node.js Express - 客户端下载栏?
问题描述
我有一个Node.js
服务器使用Express
const socketio = require('socket.io'),
http = require('http'),
path = require('path'),
express = require('express'),
app = express(),
serv = require('http').Server(app),
cors = require('cors');
var htmlPath = path.join(__dirname, 'client_data');
app.use(cors(corsOptions), express.static(htmlPath));
app.get('/', cors(corsOptions), (req, res, next) => {
res.sendFile(htmlPath + '/index.html');
});
客户端通过连接
function init() {
var url = 'http://192.168.1.5:8080';
window.open(url, 'theFrame');
}
我正在尝试为Download Progress Bar
通过 Express 检索到的文件添加一个用于客户端(也可以用于服务器端)。这可能吗?谢谢!
解决方案
推荐阅读
- c# - LINQ 搜索类似字符串(名称)
- c++ - 当用于字符串时,C++ 映射没有匹配的成员函数来调用“find”
- amazon-web-services - 在 AWS EC2 中的多合一 HA 部署配置上配置两个 WSO2AM 节点
- android - 如何使用 Geolocator Plugin 在 Flutter 中检测 Mock 位置
- javascript - 提取多个两个括号之间的文本
- html - CSS动画延迟到子div
- javascript - 文件名的 Date.now() 可能会产生冲突吗?
- javascript - 反应原生聆听组件的选项卡更改?
- c - CLion:不能包含 Math.h
- nestjs - 一对多关系类型