This is what I got. It works great but I'd like to be able to send a file and data (JSON), to the client when he logs in my website. Is there any way to combine that?
app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});
You can't send 2 files at once. But you can embed the JSON inside the html by using a template library with ejs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With