mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-03 10:17:00 +02:00
8 lines
207 B
TypeScript
8 lines
207 B
TypeScript
/**
|
|
* Extract port from a URL string
|
|
*/
|
|
export function getPortFromUrl(url: string): string {
|
|
const parsedUrl = new URL(url);
|
|
return parsedUrl.port || (parsedUrl.protocol === 'https:' ? '443' : '80');
|
|
}
|