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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user