Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some boring breaking changes #66

Merged
merged 2 commits into from
Jul 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions createClient.js
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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)
Expand Down
34 changes: 15 additions & 19 deletions createServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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"')
Expand All @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down