Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F21589402
get-app-port.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
689 B
Referenced Files
None
Subscribers
None
get-app-port.ts
View Options
import
{
loadAppConfigModule
}
from
"./load-app-config.js"
;
function
parsePort
(
value
:
unknown
)
:
number
|
null
{
if
(
typeof
value
===
"number"
&&
Number
.
isFinite
(
value
))
{
return
value
;
}
if
(
typeof
value
===
"string"
&&
value
.
trim
()
!==
""
)
{
const
parsed
=
Number
.
parseInt
(
value
,
10
);
if
(
Number
.
isFinite
(
parsed
))
{
return
parsed
;
}
}
return
null
;
}
export
async
function
getAppPort
(
projectDir
:
string
)
:
Promise
<
number
|
null
>
{
const
configModule
=
await
loadAppConfigModule
(
projectDir
);
const
configPort
=
configModule
?
parsePort
(
configModule
.
PORT
)
:
null
;
if
(
configPort
!==
null
)
{
return
configPort
;
}
return
parsePort
(
process
.
env
.
SEALIOUS_PORT
??
null
);
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, Nov 7, 17:35 (4 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1182034
Default Alt Text
get-app-port.ts (689 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline