Skip to content
Snippets Groups Projects
Commit 72d50110 authored by Ahmad, Rezwan (PG/T - Comp Sci & Elec Eng)'s avatar Ahmad, Rezwan (PG/T - Comp Sci & Elec Eng)
Browse files

Creating Routes - Registration and Login

parent e30d1ee1
No related branches found
No related tags found
1 merge request!9Create endpoint for user-registration
import { Router } from "express";
const router = Router();
// /** POST Methods */
router.route('/register').post((req, res) => res.json('Register Route'));
router.route('/login').post((req, res) => res.json('Login Route'));
export default router;
\ No newline at end of file
......@@ -2,6 +2,7 @@ import express from 'express';
import cors from 'cors';
import morgan from 'morgan';
import connect from './database/conn.js'
import router from './router/route.js'
const app = express();
......@@ -17,6 +18,9 @@ app.get('/', (req, res) => {
res.status(201).json("Home GET Request")
});
// API Routes
app.use('/api', router)
// Start server only when we have valid connection
connect().then(() => {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment