web/routes/index.js

71 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-11-02 06:20:20 +01:00
const express = require('express')
const router = express.Router()
var registerlogin = require("./registerlogin");
2021-11-16 00:44:33 +01:00
let product_controller = require("../controllers/productController");
router.post("/register", registerlogin.register);
router.post("/login", registerlogin.login);
router.get("/verify-email", registerlogin.verifyemail);
2021-11-02 06:20:20 +01:00
router.get('/', (_req, res) => {
2021-11-09 03:11:53 +01:00
res.render('pages/index');
})
2021-11-09 03:20:03 +01:00
router.get('/login', (_req, res) => {
2021-11-09 03:11:53 +01:00
res.render('pages/login');
})
2021-11-09 03:20:03 +01:00
router.get('/forgot-password', (_req, res) => {
2021-11-09 03:11:53 +01:00
res.render('pages/forgot-password');
})
2021-11-09 03:20:03 +01:00
router.get('/otp', (_req, res) => {
2021-11-09 03:11:53 +01:00
res.render('pages/otp');
})
router.get('/change-password', (_req, res) => {
res.render('pages/change-password');
})
2021-11-15 10:55:33 +01:00
router.get('/products', (_req, res) => {
2021-11-16 00:44:33 +01:00
product_controller.getProducts().then(data => {
res.render('pages/products', {data: data});
})
2021-11-15 10:55:33 +01:00
})
2021-11-16 00:44:33 +01:00
router.get('/product/:id', (req, res) => {
product_controller.getProduct(req.params.id).then(data => {
res.render('pages/product', {data: data});
})
2021-11-02 06:20:20 +01:00
})
router.get(('/successadd'), (_req, res) => {
2021-11-09 03:12:36 +01:00
res.render('pages/success-add')
2021-11-02 06:20:20 +01:00
})
router.get('/bag', (_req, res) => {
2021-11-02 06:20:20 +01:00
res.render('pages/bag')
})
router.get('/checkout', (_req, res) => {
2021-11-02 06:20:20 +01:00
res.render('pages/checkout')
})
router.get('/notifpay', (_req, res) => {
2021-11-09 03:12:36 +01:00
res.render('pages/notif-pay')
2021-11-02 06:20:20 +01:00
})
router.get('/payment', (_req, res) => {
2021-11-02 06:20:20 +01:00
res.render('pages/payment')
})
router.get('/register', (_req, res) => {
res.render('pages/register')
})
router.get('/about-us', (_req, res) => {
res.render('pages/about-us')
})
2021-11-02 06:20:20 +01:00
module.exports = router;