Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 1.39 KB

README.md

File metadata and controls

63 lines (48 loc) · 1.39 KB

adminjs-feathers

An adapter to connect AdminJS to FeathersJS

Usage

Register the adapter

AdminJS.registerAdapter({ Database, Resource })

Create a resource

export const CompanyResource: ResourceWithOptions = {
	resource: {
		service: app.service('company'),
		schema: companySchema,
		options: {
			//Resource level options
			applyDefaults: true,
			databaseName: 'FeathersJS',
			treatNullableAsOptional: true,
			provider: 'adminJS',
		},
	},
	options: {},
}

Load your resource into AdminJS

const admin = new AdminJS({
	resources: [CompanyResource],
	rootPath: '/admin',
})

Options

Since v0.1.0 the following options are available as both global and resource level options

Property Default Version
applyDefaults true 0.10.0
treatNullableAsOptional true 0.10.0
provider 'adminJS' 0.10.0
databaseName 'FeathersJS' 0.10.0

Global options example

globalOptions.set({
	applyDefaults: true,
	databaseName: 'FeathersJS',
	treatNullableAsOptional: true,
	provider: 'adminJS',
})

Example

Example YouTube video