@bfwk/baas-server
v0.10.11
Published
[![npm](https://img.shields.io/npm/v/@bfwk/baas-server)](https://www.npmjs.com/package/@bfwk/baas-server)
Downloads
11
Readme
@bfwk/baas-service
OOTB set up for an offcore LWR builder based on bfwk.
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
import { createBaasServer } from '@bfwk/baas-server';
import {
ComponentShapeMetadataService,
ViewMetadataServiceImpl,
TemplateMetadataServiceImpl,
DeclarativeTypeMetadataService,
DataProviderMetadataService,
ActionMetadataService,
} from './metadata-services';
const __dirname = dirname(fileURLToPath(import.meta.url));
createBaasServer({
rootCmp: 'sample_builder/builder',
lwrConfig: {
lwc: {
modules: [
{
dir: resolve(__dirname, '../../src', 'metadata/components'),
},
],
},
},
metadataServices: [
new ComponentShapeMetadataService(),
new ViewMetadataServiceImpl(),
new TemplateMetadataServiceImpl(),
new DataProviderMetadataService(),
new DeclarativeTypeMetadataService(),
new ActionMetadataService(),
],
});
Metadata Service
Every metadata service added to the initial configuration will automatically have an express route exposed following a set route scheme.
Example:
The following MetadataService is accessible on the client via the endpoint /metadata/view/
export class ViewMetadataServiceImpl extends FilebasedMetadataServiceImpl<
ViewResource
> {
constructor() {
super('view', {
read: {
dirs: ['**/metadata/tmp/**'],
},
write: {
dir: SAMPLE_VIEW_SAVE_DIR,
},
});
}
}