煩呀,我諗,如果有mutithread,客流量又唔太高嘅話,其實無乜需要做async?
同埋未有async await之前,要寫async logic都幾多boilerplate
當然而家情況唔同晒啦
if (typeof query.page !== 'string') {
return;
}
await db.find({ page: query.page })
if (req.method !== 'GET') {
return res.status(405).send('Method Not Allowed');
}