mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-29 17:38:04 +01:00
89aa6220ca
* Extract bw serve endpoint configuration to a configurator class * Add device-approval endpoints to bw serve
26 lines
917 B
TypeScript
26 lines
917 B
TypeScript
import { program } from "commander";
|
|
|
|
import { registerOssPrograms } from "@bitwarden/cli/register-oss-programs";
|
|
import { ServeProgram } from "@bitwarden/cli/serve.program";
|
|
|
|
import { BitServeConfigurator } from "./bit-serve-configurator";
|
|
import { registerBitPrograms } from "./register-bit-programs";
|
|
import { ServiceContainer } from "./service-container";
|
|
|
|
async function main() {
|
|
const serviceContainer = new ServiceContainer();
|
|
await serviceContainer.init();
|
|
|
|
await registerOssPrograms(serviceContainer);
|
|
await registerBitPrograms(serviceContainer);
|
|
|
|
const serveConfigurator = new BitServeConfigurator(serviceContainer);
|
|
new ServeProgram(serviceContainer, serveConfigurator).register();
|
|
|
|
program.parse(process.argv);
|
|
}
|
|
|
|
// Node does not support top-level await statements until ES2022, esnext, etc which we don't use yet
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
main();
|