変数を含んだpathでも特定のpathが含まれているかを確認する場合。
const noCheckPaths = /api/v1/user/${userId}などの場合
noCheckPaths.map(o => (`^${o}$`)).some(o => RegExp(o).test(ctx.path)))
More than 3 years have passed since last update.
変数を含んだpathでも特定のpathが含まれているかを確認する場合。
const noCheckPaths = /api/v1/user/${userId}などの場合
noCheckPaths.map(o => (`^${o}$`)).some(o => RegExp(o).test(ctx.path)))
Register as a new user and use Qiita more conveniently