我正在创建一个聊天工具,使用服务器端的
但是,当我尝试在我的
NodeJS
中的 Express
,并在客户端中使用 AngularJS
进行管理。但是,当我尝试在我的
html
中包含 /js/code.js
时,它无法找到,因为它没有被 Express
路由。<!-- my include in html -->
<script src="./js/code.js"></script> <!- this is not found in execution -->
Meu index.js:
var app = require('express')();
var http = require('http').Server(app);
var io = require("socket.io")(http);
app.get('/', function(request, response){
response.sendFile(__dirname + '/index.html');
});
如何解决这个问题,而不必将我将在项目中使用的所有js文件路由或路由许多js文件的路径?