在节点js中加载本地jquery.js文件

Ble*_*ien 5 javascript jquery node.js socket.io

我想在我的节点js聊天应用程序中加载本地jquery文件.我搜索了很多,但我找不到合适的解决方案.

<!doctype html>
<html>
  <head>
    <title>Socketio</title>
  </head>
  <body>
      <!--This wont work -->
      <script src="/socket.io/jquery.min.js"></script> 
        <!--This will work -->
      <script src="/socket.io/socket.io.js"></script>

  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

我只是复制的jquery.js文件socket.iofolder.The socket.io.js正常文件加载但jQuery的文件didnt.Please帮我这里是我的index.js文件

var app = require('express')();
var server = require('http').Server(app);
var io = require('socket.io')(server);


app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});

server.listen(3000, function(){
  console.log('listening on *:3000');
});
Run Code Online (Sandbox Code Playgroud)

Ble*_*ien 1

最后我找到了答案。我只是通过这种方式从本地加载jquery文件http://localhost/assets/jquery.min.js