【发布时间】:2018-12-23 09:06:37
【问题描述】:
这是我在我的计算机上设置的一个简单服务器,我要做的就是在我的 html 文件中加载一个脚本文件。
var express=require('express');
var app=express();
app.listen(3000);
app.use(express.static('/scripts'));
app.get('/', function(req,res){
res.sendFile(__dirname+'/index.html');
});
Here is my html file containing the script
<!doctype html>
<html>
<head>
<title>Async Javascript</title>
</head>
<body>
<h1>Hello Web</h1>
<!--scripts-->
<script src="scripts/app.js"></script>
</body>
</html>
【问题讨论】:
标签: javascript html node.js google-chrome scripting