From ad5ea97cd0d1edef48c81203e8e68453468445f7 Mon Sep 17 00:00:00 2001 From: GEEKiDoS Date: Wed, 10 Apr 2024 12:54:47 +0800 Subject: [PATCH] add running information --- src/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 5e2ea99..f95cee0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -63,7 +63,7 @@ async function main(): Promise { .use(eacnet) .use(async (ctx, next) => { if (!ctx.service) { - throw new Error('invaild service'); + return await next(); } ctx.logger = ctx.service @@ -136,7 +136,10 @@ async function main(): Promise { ctx.status = 200; logger.info('%s.%s [server]: status = %d', ctx.service.name, ctx.service.method, ctx.status); - return await next(); + }) + .use(async (ctx, next) => { + ctx.body = 'Laochan-Eacnet is running.'; + return next(); }); logger.info('listening on %d', config.port);