RPC: temporarily disable argument guards, add cookie support for SSR

(now with full isomorphism... almost!)
This commit is contained in:
41666 2019-03-10 15:24:05 -05:00
parent f30ca78e40
commit c32ee37ca5
5 changed files with 47 additions and 10 deletions

View file

@ -1,4 +1,13 @@
// @flow
import RPCClient from '../rpc'
export default (new RPCClient({ forceDev: false })).rpc
const client = new RPCClient({ forceDev: false })
export default client.rpc
export const withCookies = (ctx: any) => {
if (ctx.req != null) {
return client.withCookies(ctx.req.headers.cookie)
} else {
return client.rpc
}
}