From ca175fdcae12105bcd51bced53b420b36cc1f714 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 23 Sep 2024 23:57:12 +0530 Subject: [PATCH] feat: register route --- server/src/routes/auth.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index dabd4855..bc2d9bbb 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -1,9 +1,11 @@ +import { Router } from 'express'; import { hashPassword, comparePassword } from '../utils/auth'; import bcrypt from 'bcrypt'; import jwt from 'jsonwebtoken'; // Todo: DB +export const router = Router(); -const register = async (req, res) => { +router.post('/register', async (req, res) => { try { const { email, password } = req.body @@ -34,7 +36,7 @@ const register = async (req, res) => { } catch (error) { res.status(500).send(`Could not register user - ${error.message}`) } -} +}) const login = async (req, res) => { try {