【发布时间】:2017-11-28 09:05:35
【问题描述】:
是否可以在 nodejs 中没有给定代码的情况下使用 node js 运行 angular2? 如果我不想在 nodejs 中使用 dist 文件夹怎么办?
app.use('/', express.static('dist'));
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname + '/index.html'));
});
【问题讨论】:
-
dist 文件夹是 typescript 编译为
javascript因为浏览器不理解 typescript。另外能否请您说明删除上述nodejs代码的原因 -
@Dhyey 因为我每次进行更改时都必须运行
ng build,而我无法通过ng serve进行调整