chore: format
This commit is contained in:
parent
0093d426c6
commit
70fd552e88
2 changed files with 31 additions and 34 deletions
|
@ -13,12 +13,10 @@ type Protocol = 'http' | 'https'
|
|||
|
||||
// this code from vite https://github.com/vitejs/vite/blob/d09bbd093a4b893e78f0bbff5b17c7cf7821f403/packages/vite/src/node/utils.ts#L892-L914
|
||||
export function getNetworkAddress(protocol: Protocol = 'http', hostname: string | undefined, port: number, base?: string) {
|
||||
|
||||
const NetworkAddress: NetworkAddressOpt = {
|
||||
local: [],
|
||||
network: []
|
||||
}
|
||||
|
||||
Object.values(os.networkInterfaces())
|
||||
.flatMap((nInterface) => nInterface ?? [])
|
||||
.filter(
|
||||
|
|
|
@ -61,8 +61,7 @@ export default function startServer(app: NodeApp, options: Options) {
|
|||
if (host === undefined) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(
|
||||
`Preview server listening on \n local: ${address.local[0]} \t\n network: ${address.network[0]}
|
||||
` );
|
||||
`Preview server listening on \n local: ${address.local[0]} \t\n network: ${address.network[0]}\n`);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Preview server listening on ${address.local[0]}`);
|
||||
|
|
Loading…
Reference in a new issue