diff --git a/createClient.js b/createClient.js index 4908aa0..b39d216 100644 --- a/createClient.js +++ b/createClient.js @@ -1,7 +1,6 @@ const feathers = require('feathers/client') const socketio = require('feathers-socketio/client') const hooks = require('feathers-hooks') -const auth = require('feathers-authentication-client') const rx = require('feathers-reactive') const Rx = require('rxjs') const io = require('socket.io-client') @@ -13,18 +12,12 @@ function createClient (options) { services = [] } = options - const localStorage = window ? window.localStorage : null - const socket = io() const client = feathers() .configure(socketio(socket)) .configure(hooks()) .configure(rx(Rx)) - .configure(auth({ - storage: localStorage, - accessTokenKey: 'dogstack' - })) services.map(service => { client.configure(service) diff --git a/createServer.js b/createServer.js index caa062b..745128c 100644 --- a/createServer.js +++ b/createServer.js @@ -11,8 +11,8 @@ const favicon = require('serve-favicon') const errorHandler = require('feathers-errors/handler') const configuration = require('feathers-configuration') const hooks = require('feathers-hooks') +const rest = require('feathers-rest') const socketio = require('feathers-socketio') -const authentication = require('feathers-authentication') const createBundler = require('./createBundler') @@ -48,6 +48,20 @@ function createServer (options) { assert(faviconConfig, 'must set `favicon` in config. example: "app/favicon.ico"') app.use(favicon(faviconConfig)) + // feathers hooks + app.configure(hooks()) + + // transports + app.configure(rest()) + app.configure(socketio({ + wsEngine: 'uws' + })) + + // services (plugins) + services.forEach(service => { + app.configure(service) + }) + // static files const assetsConfig = app.get('assets') assert(assetsConfig, 'must set `assets` in config. example: "assets"') @@ -74,24 +88,6 @@ function createServer (options) { } app.use(createBundler(merge(defaultBundlerConfig, bundlerConfig))) - // feathers hooks - app.configure(hooks()) - - // transports - app.configure(socketio({ - wsEngine: 'uws' - })) - - // authentication - const authConfig = app.get('auth') - assert(authConfig, 'must set `auth` in config.') - app.configure(authentication(authConfig)) - - // services (plugins) - services.forEach(service => { - app.configure(service) - }) - // log errors app.use(function (err, req, res, next) { if (err) console.error('error', err) diff --git a/package.json b/package.json index 87af616..89cf30a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dogstack", - "version": "0.2.2", + "version": "0.3.0-pre.0", "description": "a popular-choice grab-bag framework for teams working on production web apps", "main": "index.js", "browser": "browser.js", @@ -50,12 +50,11 @@ "compression": "^1.6.2", "es2040": "^1.2.5", "feathers": "^2.1.2", - "feathers-authentication": "^1.2.3", - "feathers-authentication-client": "^0.3.2", "feathers-configuration": "^0.4.1", "feathers-errors": "^2.8.0", "feathers-hooks": "^2.0.1", "feathers-reactive": "^0.4.1", + "feathers-rest": "^1.7.3", "feathers-socketio": "^2.0.0", "fela-beautifier": "^4.3.5", "fela-font-renderer": "^4.3.5",