Compare commits
No commits in common. "b30fc0235d9972e3b9f439d5b11cf8de97a077e1" and "69b3d1fd726265f943d4bacb6cc72652447a9157" have entirely different histories.
b30fc0235d
...
69b3d1fd72
12
src/app/app.config.server.ts
Normal file
12
src/app/app.config.server.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
||||||
|
import { provideServerRendering, withRoutes } from '@angular/ssr';
|
||||||
|
import { appConfig } from './app.config';
|
||||||
|
import { serverRoutes } from './app.routes.server';
|
||||||
|
|
||||||
|
const serverConfig: ApplicationConfig = {
|
||||||
|
providers: [
|
||||||
|
provideServerRendering(withRoutes(serverRoutes))
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
export const config = mergeApplicationConfig(appConfig, serverConfig);
|
||||||
12
src/app/app.routes.server.ts
Normal file
12
src/app/app.routes.server.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { RenderMode, ServerRoute } from '@angular/ssr';
|
||||||
|
|
||||||
|
export const serverRoutes: ServerRoute[] = [
|
||||||
|
{
|
||||||
|
path: 'admin/login',
|
||||||
|
renderMode: RenderMode.Prerender
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '**',
|
||||||
|
renderMode: RenderMode.Client
|
||||||
|
}
|
||||||
|
];
|
||||||
@ -16,11 +16,16 @@ const enum AdminRouteTitles {
|
|||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
redirectTo: 'about',
|
redirectTo: 'admin/about',
|
||||||
pathMatch: 'full'
|
pathMatch: 'full'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: 'admin',
|
||||||
|
redirectTo: 'admin/about',
|
||||||
|
pathMatch: 'full'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'admin',
|
||||||
component: AdminLayout,
|
component: AdminLayout,
|
||||||
title: 'Admin',
|
title: 'Admin',
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
8
src/main.server.ts
Normal file
8
src/main.server.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { BootstrapContext, bootstrapApplication } from '@angular/platform-browser';
|
||||||
|
import { App } from './app/app';
|
||||||
|
import { config } from './app/app.config.server';
|
||||||
|
|
||||||
|
const bootstrap = (context: BootstrapContext) =>
|
||||||
|
bootstrapApplication(App, config, context);
|
||||||
|
|
||||||
|
export default bootstrap;
|
||||||
Loading…
Reference in New Issue
Block a user