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

Testing controllers - Register and Login for POST requests

parent 72d50110
No related branches found
No related tags found
1 merge request!9Create endpoint for user-registration
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
/** POST: http://localhost:8080/api/register
* @param : {
"username" : "example123",
"password" : "admin123",
"email": "example@gmail.com",
"profile": ""
}
*/
export async function register(req,res){
res.json('register route')
}
/** POST: http://localhost:8080/api/login
* @param: {
"username" : "example123",
"password" : "admin123"
}
*/
export async function login(req,res){
res.json('register route')
}
\ No newline at end of file
import { Router } from "express";
import * as controller from '../controllers/appController.js';
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'));
router.route('/register').post(controller.register); // Register
router.route('/login').post(controller.login); // Login
export default router;
\ No newline at end of file
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