index.js 507 Bytes
Newer Older
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
1
const express = require("express");
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
2 3
const router = express.Router();

Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
4
const authController = require("../../controllers/auth");
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
5

Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
6 7
router.get("/get", (req, res) => {
  res.json({ test: "Test get" });
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
8 9
});

Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
10 11 12
router.get("/getUserById/:id", authController.getUserById);
router.post("/register", authController.register);
router.post("/login", authController.login);
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
13
router.get('/currentuser', authController.currentUser);
14
// router.put('/updateProfile/:id', authController.updateProfile)
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
15 16

module.exports = router;