Open History to see the last commit
1import type { BootstrapContext } from '@angular/platform-browser'
2import { mergeApplicationConfig } from '@angular/core'
3import { provideServerRendering, withRoutes } from '@angular/ssr'
4import { QueryClient } from '@tanstack/angular-query-experimental'
5import { getBaseAppConfig, sharedQueryDefaults } from './app.config'
6import { serverRoutes } from './app.routes.server'
7β
8const createServerQueryClient = () =>
9 new QueryClient({
10 defaultOptions: {
11 queries: {
12 ...sharedQueryDefaults,
13 retry: false,
14 },
15 },
16 })
17β
18export const getServerConfig = (_context: BootstrapContext) =>
19 mergeApplicationConfig(getBaseAppConfig(createServerQueryClient()), {
20 providers: [provideServerRendering(withRoutes(serverRoutes))],
21 })