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