export const getURL = ( url , port = 4000 ) : string => `http://localhost:${ port }${ url }` ; export const callNetwork = async ( promise ) : Promise < { status : number ; response : any ; } > => { let response ; let status ; try { const result = await promise ; response = result . data ; status = result . status ; } catch ( error ) { status = error . response . status ; response = error . response . data ; } return { status , response } ; } ;