Start setting up FORM parser
This commit is contained in:
parent
d8bf0cfbd1
commit
bedff8c0f5
@ -26,7 +26,7 @@ app.onError((err: Error, c: Context) => {
|
||||
}
|
||||
|
||||
return c.json({ message: "An error occurred." });
|
||||
})
|
||||
});
|
||||
|
||||
//
|
||||
// set routes
|
||||
@ -57,5 +57,4 @@ app.get('/:channel', (c: Context) => {
|
||||
|
||||
|
||||
// feed actions
|
||||
console.log("Running app on :3000");
|
||||
export default app;
|
||||
|
@ -2,12 +2,10 @@ import { Context } from 'hono';
|
||||
|
||||
export default async function parsedForm(c: Context, next) {
|
||||
if (c.req.method == 'POST') {
|
||||
if (c.req.header('Content-Type') == 'application/json') {
|
||||
if (c.req.header('Content-Type') === 'application/x-www-form-urlencoded') {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
next();
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ app.post('/register', async (c: Context) => {
|
||||
|
||||
try {
|
||||
const results = await conn.query(query, [
|
||||
user.username,
|
||||
user.email,
|
||||
user.name,
|
||||
user.password
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user