Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions apps/api/src/cli/commands/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@
* Replaces scripts/dev-services-cli.ts with a proper CLI subcommand.
* Plain console output — no Ink UI needed for these one-shot commands.
*/
function externalUrlOrNull(url: string | undefined): string | null {
if (!url) return null;
try {
const parsed = new URL(url);
const host = parsed.hostname;
if (host === "localhost" || host === "127.0.0.1" || host === "::1") {
return null;
}
return url;
} catch {
return null;
}
}
import { externalUrlOrNull } from "../../settings/resolve-config";

export interface ServicesOptions {
subcommand: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/settings/resolve-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function toBoolWithDefault(
* Determine if a URL points to a non-local host (i.e., an external service).
* Returns the URL string if external, null if local or not set.
*/
function externalUrlOrNull(url: string | undefined): string | null {
export function externalUrlOrNull(url: string | undefined): string | null {
if (!url) return null;
try {
const parsed = new URL(url);
Expand Down
Loading