fix: support api through GET so that the test work. We'll add POST in test later

Massimo Melina committed Dec 14, 2021 at 23:34 UTC 97dd835fb05ebfbdf8532cc01c826cc92251bbc3
1 file changed +1 -1
src/index.ts
+1 -1
@@ -23,7 +23,7 @@ srv.use(mount(API_URI, new Koa().use(bodyParser()).use(apiMw(frontEndApis))))
23 const serveFrontendPrefixed = mount(FRONTEND_URI.slice(0,-1), serveFrontend)
24 srv.use(async (ctx, next) => {
25 const { path } = ctx
26 - if (ctx.method !== 'GET')
26 + if (ctx.method !== 'GET' || ctx.body)
27 return await next()
28 if (path.endsWith('/'))
29 return await serveFrontend(ctx,next)