1
anglecliで作成された2つの別々のAngularアプリがあります。どちらも、角度ユニバーサルを経由してnode.jsサーバーで実行するように既に変更されています(例:Angular's tutorial)。各アプリが異なるindex.html
ファイルを持っているので、私は2つのビューエンジンを作成する必要があると思いますが、どのように私は1つのルートにつのエンジンを使用するようにExpressを伝えることができ複数のAngular Universalアプリを1つのExpressアプリで提供
app.engine('html', (_, options, callback) => {
renderModuleFactory(AppServerModuleNgFactory, {
// Our index.html
document: template,
url: options.req.url,
// DI so that we can get lazy-loading to work differently (since we need it to just instantly render it)
extraProviders: [
provideModuleMap(LAZY_MODULE_MAP)
]
}).then(html => {
callback(null, html);
});
});
app.set('view engine', 'html');
:
の例では、ビューエンジンを作成し、別のルートで別のエンジンを使用していますか? つまり、app1
を/app1
とapp2
〜/app2
にマップするにはどうすればよいですか?