Permalink
Browse files

Add feathers-rest for SSR

  • Loading branch information...
leoj3n committed Oct 29, 2018
1 parent af2c9d9 commit bce502921c9d49b6efab90fb48e4d841217ba516
@@ -0,0 +1,9 @@
import rest from '@feathersjs/rest-client';
import feathers from '@feathersjs/feathers';

const restClient = rest();
const feathersClient = feathers();

feathersClient.configure(restClient.fetch(window.fetch));

export default feathersClient;
@@ -0,0 +1,10 @@
import io from 'steal-socket.io';
import feathers from '@feathersjs/feathers';
import socketio from '@feathersjs/socketio-client';

const socket = io();
const feathersClient = feathers();

feathersClient.configure(socketio(socket));

export default feathersClient;
@@ -1,10 +1,3 @@
import io from 'steal-socket.io';
import feathers from '@feathersjs/feathers';
import socketio from '@feathersjs/socketio-client';

const socket = io();
const feathersClient = feathers();

feathersClient.configure(socketio(socket));
import feathersClient from '~/models/feathers-client-#{~/models/rest-or-socketio}';

export default feathersClient;
@@ -0,0 +1,3 @@
const restOrSocketio = System.isPlatform('window') ? 'socketio' : 'rest';

export default restOrSocketio;
@@ -12,6 +12,7 @@
},
"dependencies": {
"@feathersjs/feathers": "^3.1.7",
"@feathersjs/rest-client": "^1.4.5",
"@feathersjs/socketio-client": "^1.1.5",
"bootstrap": "^3.3.7",
"can": "^5.15.1",
@@ -24,6 +25,7 @@
"jquery": "^3.3.1",
"rollup": "^0.66.6",
"steal": "^2.0.0",
"steal-conditional": "^1.1.1",
"steal-less": "^1.3.2",
"steal-socket.io": "^4.1.0",
"steal-stache": "^4.1.2",
@@ -43,7 +45,8 @@
],
"configDependencies": [
"live-reload",
"node_modules/can-zone/register"
"node_modules/can-zone/register",
"node_modules/steal-conditional/conditional"
]
}
}

0 comments on commit bce5029

Please sign in to comment.