How to include javascript on client side of node.js?

后端 未结 5 1369
南笙
南笙 2020-11-30 05:25

I\'m a beginner of node.js and javascript.

I want to include external javascript file in html code. Here is the html code, \"index.html\":



        
5条回答
  •  无人及你
    2020-11-30 05:48

    Your handler is hardcoded to always return the content of /index.html. You need to pay attention to the resource that is being requested and return the right one. (i.e. if the browser asks for simple.js then you need to give it simple.js instead of index.html).

提交回复
热议问题