feat: version 1.0.0 (#21)

This commit is contained in:
Arash
2023-09-20 19:47:07 +03:00
committed by GitHub
parent 033380e051
commit 431d3784fe
42 changed files with 3654 additions and 3219 deletions

23
src/rpc/index.ts Normal file
View File

@ -0,0 +1,23 @@
import mongoose from 'mongoose'
import type { DevtoolsServerContext, ServerFunctions } from '../types'
import { setupDatabaseRPC } from './database'
import { setupResourceRPC } from './resource'
export function setupRPC(ctx: DevtoolsServerContext): ServerFunctions {
mongoose.connect(ctx.options.uri, ctx.options.options)
return {
getOptions() {
return ctx.options
},
...setupDatabaseRPC(ctx),
...setupResourceRPC(ctx),
async reset() {
const ws = await ctx.wsServer
ws.send('nuxt-mongoose:reset')
},
}
}