Add TODO for SSR SEO
This commit is contained in:
parent
798c4987f8
commit
279b859e7b
@ -1,2 +1,3 @@
|
|||||||
export * from './PromiseMiddleware'
|
export * from './PromiseMiddleware'
|
||||||
export * from './ReduxLogger'
|
export * from './ReduxLogger'
|
||||||
|
export * from './WaitMiddleware'
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export class ClientRenderer<State, A extends Action, D extends IAPIDef>
|
|||||||
target = document.getElementById('container'),
|
target = document.getElementById('container'),
|
||||||
} = this.params
|
} = this.params
|
||||||
|
|
||||||
const http = new HTTPClient<D>(config.baseUrl)
|
const http = new HTTPClient<D>(config.baseUrl + '/api')
|
||||||
|
|
||||||
const history = createBrowserHistory({
|
const history = createBrowserHistory({
|
||||||
basename: config.baseUrl,
|
basename: config.baseUrl,
|
||||||
|
|||||||
@ -23,10 +23,11 @@ export class ServerRenderer<State, A extends Action, D extends IAPIDef>
|
|||||||
url: string,
|
url: string,
|
||||||
config: IClientConfig,
|
config: IClientConfig,
|
||||||
state?: any,
|
state?: any,
|
||||||
|
host: string = '',
|
||||||
) {
|
) {
|
||||||
const {RootComponent} = this
|
const {RootComponent} = this
|
||||||
const store = this.createStore(state)
|
const store = this.createStore(state)
|
||||||
const http = new HTTPClient<D>(config.baseUrl)
|
const http = new HTTPClient<D>(host + config.baseUrl + '/api')
|
||||||
|
|
||||||
const context: StaticRouterContext = {}
|
const context: StaticRouterContext = {}
|
||||||
const stream = renderToNodeStream(
|
const stream = renderToNodeStream(
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import {ReduxLogger, PromiseMiddleware} from '../middleware'
|
import {ReduxLogger, PromiseMiddleware, WaitMiddleware} from '../middleware'
|
||||||
import {
|
import {
|
||||||
applyMiddleware,
|
applyMiddleware,
|
||||||
createStore as create,
|
createStore as create,
|
||||||
@ -27,6 +27,7 @@ export function createStore<State, A extends Action>(
|
|||||||
&& typeof window.localStorage.log !== 'undefined',
|
&& typeof window.localStorage.log !== 'undefined',
|
||||||
).handle,
|
).handle,
|
||||||
new PromiseMiddleware().handle,
|
new PromiseMiddleware().handle,
|
||||||
|
new WaitMiddleware().handle,
|
||||||
]
|
]
|
||||||
return (state?: DeepPartial<State>) => create(
|
return (state?: DeepPartial<State>) => create(
|
||||||
params.reducer,
|
params.reducer,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user