diff --git a/server/src/index.ts b/server/src/index.ts index 22719bf..e22b7e2 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -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; diff --git a/server/src/middleware/form-to-json.ts b/server/src/middleware/form-to-json.ts index 46cc37c..5750da0 100644 --- a/server/src/middleware/form-to-json.ts +++ b/server/src/middleware/form-to-json.ts @@ -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') { - next(); - } else { - + if (c.req.header('Content-Type') === 'application/x-www-form-urlencoded') { + } } - + next(); } diff --git a/server/src/routes/user.ts b/server/src/routes/user.ts index 78bad4d..4b18856 100644 --- a/server/src/routes/user.ts +++ b/server/src/routes/user.ts @@ -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 ]);