Skip to content

GaborTorma/feathers-nitro-adapter

Repository files navigation

feathers-nitro-adapter

npm version npm downloads License code style

Nitro adapter plugin for FeathersJS API

🏀 Online playground

Install

pnpm install -D @gabortorma/feathers-nitro-adapter

Usage in Nuxt v3

Create a new nitro plugin file in server/plugins folder:

Express adapter example:

// server/plugins/feathers-express.ts
import { createFeathersExpressAdapterNitroPlugin } from '@gabortorma/feathers-nitro-adapter'
import { app } from 'feathers-api/src/app' // import your feathers app from workspace

export default createFeathersExpressAdapterNitroPlugin(app)

See Express fixture in test cases.

Koa adapter example:

// server/plugins/feathers-koa.ts
import { createFeathersKoaAdapterNitroPlugin } from '@gabortorma/feathers-nitro-adapter'
import { app } from 'feathers-api/src/app' // import your feathers app from workspace

export default createFeathersKoaAdapterNitroPlugin(app)

See Koa fixture in test cases.

Socket.io adapter example:

// server/plugins/feathers-socket.io.ts
import { createFeathersSocketIoAdapterNitroPlugin } from '@gabortorma/feathers-nitro-adapter'
import { app } from 'feathers-api/src/app'

export default createFeathersSocketIoAdapterNitroPlugin(app)

See Socket.io fixture in test cases.

More example

You can check the playground folder for complex example with rest and socket.io transport and authentication.