Skip to content

Commit d7e9e88

Browse files
author
Manus AI
committed
fix: Support full URL with protocol in --host parameter
The --host parameter now accepts full URLs with protocol (http:// or https://) instead of hardcoding https. This allows users to register against local development instances using http://localhost:8000. Changes: - Accept full URL: https://api.fleetbase.io or http://localhost:8000 - Auto-add https:// if protocol is missing (backward compatible) - Updated option description to clarify full URL format Examples: flb register --host https://api.fleetbase.io flb register --host http://localhost:8000 flb register --host myinstance.com (defaults to https://)
1 parent 117da69 commit d7e9e88

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,10 @@ async function versionBump (options) {
723723

724724
// Command to handle registration
725725
async function registerCommand(options) {
726-
const host = options.host || 'api.fleetbase.io';
727-
const registrationApi = `https://${host}/~registry/v1/developer-account/register`;
726+
const host = options.host || 'https://api.fleetbase.io';
727+
// Ensure host has protocol, add https:// if missing
728+
const apiHost = host.startsWith('http://') || host.startsWith('https://') ? host : `https://${host}`;
729+
const registrationApi = `${apiHost}/~registry/v1/developer-account/register`;
728730

729731
try {
730732
// Collect registration information
@@ -1183,7 +1185,7 @@ program
11831185
.option('-e, --email <email>', 'Email address')
11841186
.option('-p, --password <password>', 'Password')
11851187
.option('-n, --name <name>', 'Your full name (optional)')
1186-
.option('-h, --host <host>', 'API host (default: api.fleetbase.io)')
1188+
.option('-h, --host <host>', 'API host with protocol (default: https://api.fleetbase.io)')
11871189
.action(registerCommand);
11881190

11891191
program

0 commit comments

Comments
 (0)