Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F21589098
index.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
603 B
Referenced Files
None
Subscribers
None
index.ts
View Options
import
Router
from
"@koa/router"
;
import
{
Middlewares
}
from
"sealious"
;
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
};
});
mountAutoRoutes
(
router
);
};
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, Nov 7, 16:35 (6 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1181933
Default Alt Text
index.ts (603 B)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline