I have to serve a html file with express, but also want to send an object along with the response. How can i send both - the detail.html and the object 'car' - and how can i access it at the client side?
app.get('/unit/:id', function (req, res) {
console.log(req.params.id)
var car = {type:"Fiat", model:"500", color:"white"};
res.sendFile(__dirname + '/detail.html', car);
});