put POST data into params
This commit is contained in:
parent
d48098b006
commit
68cd61227b
|
|
@ -25,6 +25,13 @@ export function startWeb(rootPath: string) {
|
|||
if (page === 'layout') return c.text('404 Not Found', 404)
|
||||
|
||||
const params = c.req.query()
|
||||
if (c.req.method === 'POST') {
|
||||
const formData = await c.req.formData()
|
||||
for (const [key, value] of formData.entries()) {
|
||||
params[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
const path = join(root, `${page}.sh`)
|
||||
const file = Bun.file(path)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user