Add TODO for SSR SEO

This commit is contained in:
Jerko Steiner 2019-05-08 11:44:45 +12:00
parent 798c4987f8
commit 279b859e7b
4 changed files with 6 additions and 3 deletions

View File

@ -1,2 +1,3 @@
export * from './PromiseMiddleware'
export * from './ReduxLogger'
export * from './WaitMiddleware'

View File

@ -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,

View File

@ -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(

View File

@ -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,