refactor: avoid promise overhead (#8028)

This commit is contained in:
Sukka
2021-08-17 02:45:53 +08:00
committed by GitHub
parent 8053b33b03
commit 6e3b58ed1d
543 changed files with 5295 additions and 5694 deletions

View File

@@ -35,7 +35,7 @@ const lazyloadRouteHandler = (routeHandlerPath) => (ctx) => {
// index
router.get('/', lazyloadRouteHandler('./routes/index'));
router.get('/robots.txt', async (ctx) => {
router.get('/robots.txt', (ctx) => {
if (config.disallowRobot) {
ctx.set('Content-Type', 'text/plain');
ctx.body = 'User-agent: *\nDisallow: /';