chore(readme.md eslintrc.js pre-commit prepare-commit-msg): update README.md add eslint commit rules
This commit is contained in:
@@ -3,7 +3,10 @@ import {
|
||||
StorageBackendDisk,
|
||||
StorageManager,
|
||||
} from '@project-chip/matter-node.js/storage';
|
||||
import { getParameter, hasParameter } from '@project-chip/matter-node.js/util';
|
||||
import {
|
||||
getParameter,
|
||||
hasParameter,
|
||||
} from '@project-chip/matter-node.js/util';
|
||||
export { Bridge } from './Bridge';
|
||||
import { Bridge } from './Bridge';
|
||||
|
||||
@@ -16,25 +19,29 @@ export function serverSetup(): {
|
||||
storageManager: StorageManager;
|
||||
} {
|
||||
if (!(MATTER_SERVER && STORAGE && STORAGE_MANAGER)) {
|
||||
const storageLocation = getParameter('store') || '/config/deviceData';
|
||||
const storageLocation =
|
||||
getParameter('store') || '/config/deviceData';
|
||||
|
||||
STORAGE = new StorageBackendDisk(
|
||||
storageLocation,
|
||||
hasParameter('clearstorage')
|
||||
hasParameter('clearstorage'),
|
||||
);
|
||||
STORAGE_MANAGER = new StorageManager(STORAGE);
|
||||
MATTER_SERVER = new MatterServer(STORAGE_MANAGER, {
|
||||
mdnsInterface: getParameter('netinterface'),
|
||||
});
|
||||
}
|
||||
return { matterServer: MATTER_SERVER, storageManager: STORAGE_MANAGER };
|
||||
return {
|
||||
matterServer: MATTER_SERVER,
|
||||
storageManager: STORAGE_MANAGER,
|
||||
};
|
||||
}
|
||||
|
||||
export function getBridge(): Bridge {
|
||||
const serverData = serverSetup();
|
||||
const bridge = Bridge.getInstance(
|
||||
serverData.matterServer,
|
||||
serverData.storageManager
|
||||
serverData.storageManager,
|
||||
);
|
||||
return bridge;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user