Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1263174
index.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
753 B
Referenced Files
None
Subscribers
None
index.ts
View Options
import
type
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, Jan 24, 16:50 (10 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
599878
Default Alt Text
index.ts (753 B)
Attached To
Mode
rREWRITE Configurable rewriter
Attached
Detach File
Event Timeline
Log In to Comment