An adapter to connect AdminJS to FeathersJS
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',
})
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 |
globalOptions.set({
applyDefaults: true,
databaseName: 'FeathersJS',
treatNullableAsOptional: true,
provider: 'adminJS',
})