Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7104452
index.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
index.ts
View Options
import
kill
from
"kill-port"
;
import
_locreq
from
"locreq"
;
import
TheApp
from
"./app.js"
;
import
{
PORT
,
SEALIOUS_SANITY
}
from
"./config.js"
;
import
{
mainRouter
}
from
"./routes/index.js"
;
import
{
waitForMeilisearch
}
from
"./services/meilisearch.js"
;
const
locreq
=
_locreq
(
new
URL
(
"./"
,
import
.
meta
.
url
).
pathname
);
export
const
the_app
=
new
TheApp
();
void
(
async
function
()
{
await
kill
(
PORT
);
await
kill
(
PORT
);
try
{
await
waitForMeilisearch
(
10
);
}
catch
(
e
)
{
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
if
((
e
as
Error
).
message
===
"timeout"
)
{
console
.
log
(
"Meilisearch must be running before the app starts!"
);
// eslint-disable-line no-console
process
.
exit
(
1
);
}
else
{
throw
e
;
}
}
try
{
the_app
.
HTTPServer
.
addStaticRoute
(
"/"
,
locreq
.
resolve
(
"public"
));
await
the_app
.
start
();
mainRouter
(
the_app
,
the_app
.
HTTPServer
.
router
);
// eslint-disable-next-line no-console
console
.
log
(
"Population finished"
);
if
(
SEALIOUS_SANITY
)
{
console
.
error
(
"Exiting with error code 0"
);
process
.
exit
(
0
);
}
}
catch
(
error
)
{
console
.
error
(
error
);
if
(
SEALIOUS_SANITY
)
{
console
.
error
(
"EXITING WITH STATUS 1"
);
process
.
exit
(
1
);
}
}
})();
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Thu, Jul 3, 03:02 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
765815
Default Alt Text
index.ts (1 KB)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment