Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7112745
index.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
748 B
Referenced Files
None
Subscribers
None
index.ts
View Options
import
Router
from
"@koa/router"
;
import
{
Middlewares
}
from
"sealious"
;
import
{
imageRouter
,
RESPONSIVE_IMAGES_URL_PATH
}
from
"../image-router.js"
;
import
{
MainView
}
from
"./common/main-view.js"
;
import
mountAutoRoutes
from
"./routes.js"
;
export
const
mainRouter
=
(
router
:
Router
)
:
void
=>
{
const
started_at
=
Date
.
now
();
// necessary to detect aplication restarts
router
.
get
(
"/"
,
Middlewares
.
extractContext
(),
async
(
ctx
)
=>
{
ctx
.
body
=
MainView
(
ctx
);
});
router
.
use
(
Middlewares
.
extractContext
());
router
.
get
(
"/status.json"
,
Middlewares
.
extractContext
(),
async
(
ctx
)
=>
{
ctx
.
body
=
{
status
:
ctx
.
$app
.
status
,
started_at
};
});
router
.
use
(
RESPONSIVE_IMAGES_URL_PATH
,
imageRouter
.
getRoutes
());
mountAutoRoutes
(
router
);
};
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jul 4, 03:43 (12 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
794122
Default Alt Text
index.ts (748 B)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment