Why would this piece of code
app.post('/api/v1/subscribe', (req, res) => {
lsq.services.get('subscribe')
.then(service => {
method: 'POST',
uri: `http://${service}/api/v1/demo/subscribe`,
json: req.body,
})
.then(rp)
});
throw error
uri: `http://${service}/api/v1/demo/subscribe`,
^
SyntaxError: Unexpected token :
My guess is that JS considers {
as function opening braces, not object opening braces. So, are we not allowed to directly return an object in a promise?