Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('feathers-configuration')()()
module.exports = require('@feathersjs/configuration')()()
21 changes: 8 additions & 13 deletions createApiServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ const assert = require('assert')
const { join, basename } = require('path')
const merge = require('ramda/src/merge')
const forEachObjIndexed = require('ramda/src/forEachObjIndexed')
const feathers = require('feathers')
const httpLogger = require('pino-http')
const feathers = require('@feathersjs/feathers')
const httpLogger = require('express-pino-logger')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

express-pino-logger is literally a nothing wrapper around pino-http, so i reckon we should stick with pino-http.

const compress = require('compression')
const helmet = require('helmet')
const cors = require('cors')
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 configuration = require('@feathersjs/configuration')
const express = require('@feathersjs/express')
const socketio = require('@feathersjs/socketio')
const forceSsl = require('express-enforces-ssl')

const createLog = require('./createLog')
Expand All @@ -30,7 +28,7 @@ function createServer (options) {
services = []
} = options

const app = feathers()
const app = express(feathers())
// load config from ./config
app.configure(configuration())

Expand Down Expand Up @@ -65,11 +63,8 @@ function createServer (options) {
origin: url.parse(assetConfig.url) // TODO: allow for whitelist to be passed
}))

// feathers hooks
app.configure(hooks())

// transports
app.configure(rest())
app.configure(express.rest())
app.configure(socketio({
wsEngine: 'uws'
}))
Expand All @@ -86,7 +81,7 @@ function createServer (options) {
})

// error handler
app.use(errorHandler())
app.use(express.errorHandler())

return (cb) => {
return startServer(app, cb)
Expand Down
11 changes: 6 additions & 5 deletions createAssetServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ const url = require('url')
const assert = require('assert')
const { join, basename } = require('path')
const merge = require('ramda/src/merge')
const feathers = require('feathers')
const configuration = require('feathers-configuration')
const httpLogger = require('pino-http')
const feathers = require('@feathersjs/feathers')
const configuration = require('@feathersjs/configuration')
const express = require('@feathersjs/express')
const httpLogger = require('express-pino-logger')
const compress = require('compression')
const helmet = require('helmet')
const favicon = require('serve-favicon')
Expand All @@ -26,7 +27,7 @@ function createServer (options) {
cwd = process.cwd()
} = options

const app = feathers()
const app = express(feathers())
// load config from ./config
app.configure(configuration())

Expand Down Expand Up @@ -57,7 +58,7 @@ function createServer (options) {

// static files
if (assetConfig.root) {
app.use('/', feathers.static(assetConfig.root, assetConfig))
app.use('/', express.static(assetConfig.root, assetConfig))
}

// javascript bundler
Expand Down
11 changes: 4 additions & 7 deletions createClient.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const feathers = require('feathers/client')
const socketio = require('feathers-socketio/client')
const hooks = require('feathers-hooks')
const rx = require('feathers-reactive')
const Rx = require('rxjs')
const feathers = require('@feathersjs/feathers')
const socketio = require('@feathersjs/socketio-client')
const reactive = require('feathers-reactive')
const io = require('socket.io-client')

module.exports = createClient
Expand All @@ -17,8 +15,7 @@ function createClient (options) {

const client = feathers()
.configure(socketio(socket))
.configure(hooks())
.configure(rx(Rx))
.configure(reactive({ idField: 'id' }))

services.map(service => {
client.configure(service)
Expand Down
6 changes: 5 additions & 1 deletion createStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ function createStore (options) {
client
} = options

const epicMiddleware = createEpicMiddleware({ dependencies: { feathers: client } })

const enhancer = composeWithDevTools(
applyMiddleware(...[
createEpicMiddleware(epic, { dependencies: { feathers: client } }),
epicMiddleware,
routerMiddleware(history),
...middlewares,
createLogger()
Expand All @@ -41,6 +43,8 @@ function createStore (options) {
const reducer = updaterToReducer(updater)
const store = Store(reducer, state, enhancer)

epicMiddleware.run(epic)

return store
}

Expand Down
Loading