I have the following code an i am not able to include the 2nd server query (command2) in the webpage. How would be the best way?
const client = require(‘rippled-ws-client’)
const express = require(‘express’)
const app = express()
const command = {
“command”: “book_offers”,
“taker_gets”: {
"currency": "XRP"
},
“taker_pays”: {
"currency": "EUR", "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
},
“limit”: 10
}
const command2 = {
“command”: “book_offers”,
“taker_gets”: {
"currency": "EUR", "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
},
“taker_pays”: {
"currency": "XRP"
},
“limit”: 10
}
const server = app.listen(7000, () => {
console.log(‘Server running’)
})
app.set(‘view engine’, ‘pug’)
app.use(express.static(__dirname + ‘/public’))
app.get(‘/’, (req, res) => {
new client(‘wss://xrpl.ws’).then(connection => {
connection.send(command).then(reply => { connection.close() console.log(reply.offers) res.render('index', { title: 'Simple orderbook', offer: reply.offers }) })
})
})
Blockquote