api/match: accept object as single argument

hi im what i do
This commit is contained in:
wukko
2024-09-02 08:27:31 +06:00
parent 93f2a6b226
commit 8cee4e58c5
2 changed files with 34 additions and 33 deletions

View File

@@ -213,9 +213,11 @@ export const runAPI = (express, app, __dirname) => {
}
try {
const result = await match(
parsed.host, parsed.patternMatch, normalizedRequest
);
const result = await match({
host: parsed.host,
patternMatch: parsed.patternMatch,
params: normalizedRequest,
});
res.status(result.status).json(result.body);
} catch {