app.js
router.get('/', (req, res) => {
var cart = req.cookies.cart;
res.sendFile(path.join(__dirname,'../../src/components/cart.html'),cart);
})
shoppingCart.html
<body>
<div id="shop" class="container mt-3">
<h2> Shopping Cart View </h2>
</div>
</body>
<script>
new Vue({
el: '#shop',
data: {
}
})
</script>
I am looking to access cookies in vue..
How can I retrieve the 'cart' data in Vue?
Is using res.send('../cart.html',cart)
the correct way?