Skip to content

Commit 7680d64

Browse files
committed
lint: lib/status/index.ts
add typing annotate Signed-off-by: Raccoon <raccoon@hackmd.io>
1 parent 8171f6b commit 7680d64

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/status/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import {Request, Response} from "express";
12
import * as realtime from "../realtime/realtime";
23

34
import config from "../config";
45

56

6-
export async function getStatus(req, res) {
7+
export async function getStatus(req: Request, res: Response): Promise<void> {
78
res.set({
89
'Cache-Control': 'private', // only cache by client
910
'X-Robots-Tag': 'noindex, nofollow', // prevent crawling
@@ -19,7 +20,7 @@ export async function getStatus(req, res) {
1920
}
2021
}
2122

22-
export async function getMetrics(req, res) {
23+
export async function getMetrics(req: Request, res: Response): Promise<void> {
2324
const data = await realtime.getStatus()
2425

2526
res.set({
@@ -30,7 +31,7 @@ export async function getMetrics(req, res) {
3031
res.render('../js/lib/common/metrics.ejs', data)
3132
}
3233

33-
export function getConfig(req, res) {
34+
export function getConfig(req: Request, res: Response): void {
3435
const data = {
3536
domain: config.domain,
3637
urlpath: config.urlPath,

0 commit comments

Comments
 (0)