开发者

Node.js including local javascript file located on web server

I have a Node.js server at

var/server/server.js

And a client at

var/www/client.js

Is it possible to开发者_JAVA百科 include the client.js from within the server somehow, using the file system address so that I can use common functions of the client.js file.


How about var client = require('../www/client.js) ?


you can include any js on the internet. so you shell be able to get yours as well... just add this on your client html site:

<script type="text/JavaScript" src="http://yourserver/server.js"></script> 
<script type="text/JavaScript" src="client.js"></script> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜