Nuxt/examples/with-feathers/src/app.js

29 lines
738 B
JavaScript
Raw Normal View History

2018-03-16 16:12:06 +00:00
import path from 'path'
import compress from 'compression'
import cors from 'cors'
import feathers from 'feathers'
import configuration from 'feathers-configuration'
import hooks from 'feathers-hooks'
import rest from 'feathers-rest'
import bodyParser from 'body-parser'
import socketio from 'feathers-socketio'
import middleware from './middleware'
import services from './services'
2017-01-11 19:13:38 +00:00
2017-10-31 13:43:55 +00:00
const app = feathers()
2017-01-11 19:13:38 +00:00
2017-10-31 13:43:55 +00:00
app.configure(configuration(path.join(__dirname, '..')))
2017-01-11 19:13:38 +00:00
app.use(compress())
2017-10-31 13:43:55 +00:00
.options('*', cors())
.use(cors())
.use(bodyParser.json())
.use(bodyParser.urlencoded({ extended: true }))
.configure(hooks())
.configure(rest())
.configure(socketio())
.configure(services)
.configure(middleware)
2017-01-11 19:13:38 +00:00
2018-03-16 16:12:06 +00:00
export default app