【发布时间】:2019-06-26 01:37:00
【问题描述】:
我正在开发一个快速应用程序,我尝试执行以下操作,但我不断收到相同的错误 - “GET http://localhost:3000/javascript/module2 net::ERR_ABORTED 404 (Not Found)”
有人可以向我指出我犯了什么错误并指出正确的方向吗?下面是我的代码 -
Module1.js
import theFunc from "./module2";
console.log("In module 1");
theFunc();
Module2.js
export default function theFunc() {
console.log("from module 2");
}
index.html
<html>
<body>
Should show the result in console.
<script type="module" src="./javascript/module1.js"></script>
</body>
</html>
提前非常感谢! :)
【问题讨论】:
标签: javascript node.js express ecmascript-6 es6-modules