feat: massive front-end overhaul and initial github release
This commit is contained in:
parent
a2b40e38bf
commit
d5a0e70580
303 changed files with 19840 additions and 676 deletions
19
src/bun/utils.ts
Normal file
19
src/bun/utils.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
import { networkInterfaces } from 'node:os';
|
||||
|
||||
const localIp = Object.values(networkInterfaces())
|
||||
.flat()
|
||||
.find((iface) => iface?.family === 'IPv4' && !iface.internal)?.address || 'localhost';
|
||||
|
||||
export const host = process.env.PUBLIC_ACCESS ? localIp : 'localhost';
|
||||
|
||||
export function checkRunning (pid: number)
|
||||
{
|
||||
try
|
||||
{
|
||||
return process.kill(pid, 0);
|
||||
} catch (error: any)
|
||||
{
|
||||
return error.code === 'EPERM';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue