如何将angular度4添加到现有的node.js应用程序

我有一个node.js应用程序设置为使用打字稿。 该应用程序应该被部署在heroku上。 node.js应用程序被设置为auth,注册和请求之类的restful api。

我想知道我需要添加什么依赖项才能开始在同一个项目中构buildangular度4应用程序。

我在github上看到一个问题,推荐使用ng init但是这不再是一个选项。 ng new创build一个全新的项目目录,而不是添加依赖项和文件。

这里还有另外一个问题,OP标记自己的答案是正确的,基本上是说“使用meteor”。

编辑:我知道如何在一个node.js应用程序在本地工作时沿着一边angular2 +应用程序,只是build立和服务index.ts文件。 但是,我怎么能angular度发展文件与git中的node.js文件共存,所以我可以编译它们并将它们部署在一起?

我有同样的情况,我有一个herokuparsing服务器,并想与Angular分组。

在我的server.js文件中:

 app.use(express.static(__dirname + '/dist')); 

(你只需要快递)

我也使用国际化,所以我做了一些事情(早期阶段,请不要判断):

 app.get('/', function(req, res) { let userLanguage = req.headers["accept-language"]; let langs = ['fr', 'en']; let preferred = userLanguage.substr(0, 2).toLowerCase(); console.log('User\'s preferred language is ' + preferred.toUpperCase()); if (langs.indexOf(preferred) >= 0) { res.redirect(preferred); } else { res.redirect('/en'); } }); 

我的NG命令:

 "postinstall": "npm run build-i18n", "i18n": "ng xi18n --output-path src/i18n --out-file messages.xlf", "build-i18n:fr": "ng build --output-path=dist/fr --aot --prod --bh /fr/ --i18n-file=src/i18n/messages.fr.xlf --i18n-format=xlf --locale=fr", "build-i18n:en": "ng build --output-path=dist/en --aot --prod --bh /en/ --i18n-file=src/i18n/messages.en.xlf --i18n-format=xlf --locale=en", "build-i18n": "npm run build-i18n:en && npm run build-i18n:fr" 

我的应用程序内置2个文件夹,用于实际的2种语言,当用户访问应用程序时,用户将被redirect到其中任何一个。