UNPKG

@lunora/cli

Version:

The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands

2 lines (1 loc) 497 B
import{readLiveDevServerState as l}from"@lunora/config";const n=new Set(["127.0.0.1","::1","[::1]","localhost"]),h=/\/$/u,a="http://localhost:8787",c=e=>e===void 0?a:l(e)?.url??a,i=(e,o,s)=>{const r=e??c(s);let t;try{t=new URL(r)}catch{o.error(`invalid --url: ${r}`);return}if(!n.has(t.hostname)&&t.protocol!=="https:"){o.error(`refusing to send the admin bearer over ${t.protocol}// to ${t.hostname} — use https for non-localhost targets`);return}return r.replace(h,"")};export{c as s,i as u};