1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-14 07:23:45 +00:00

Feature/put serve behind feature flag (#455)

* Add build-time feature flag capabilities

* Toggle `bw serve` command with `serve` flag

* Run linter and prettier
This commit is contained in:
Matt Gibson
2022-01-28 09:29:04 -05:00
committed by GitHub
parent 1b409653a2
commit 210e0502ca
9 changed files with 117 additions and 18 deletions

View File

@@ -468,22 +468,24 @@ export class Program extends BaseProgram {
this.processResponse(response);
});
program
.command("serve")
.description("Start a RESTful API webserver.")
.option("--port <port>", "The port to run your API webserver on. Default port is 8087.")
.on("--help", () => {
writeLn("\n Examples:");
writeLn("");
writeLn(" bw serve");
writeLn(" bw serve --port 8080");
writeLn("", true);
})
.action(async (cmd) => {
await this.exitIfNotAuthed();
const command = new ServeCommand(this.main);
await command.run(cmd);
});
if (CliUtils.flagEnabled("serve")) {
program
.command("serve")
.description("Start a RESTful API webserver.")
.option("--port <port>", "The port to run your API webserver on. Default port is 8087.")
.on("--help", () => {
writeLn("\n Examples:");
writeLn("");
writeLn(" bw serve");
writeLn(" bw serve --port 8080");
writeLn("", true);
})
.action(async (cmd) => {
await this.exitIfNotAuthed();
const command = new ServeCommand(this.main);
await command.run(cmd);
});
}
}
protected processResponse(response: Response, exitImmediately = false) {