是否可以将org.reactivestreams.Publisher
实例转换为scala.Stream
?如果可能,该怎么办?
答案 0 :(得分:1)
以下内容将为您工作吗?
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const port = 5000
app.use(bodyParser.json())
// response
app.post('/', (req, res) => {
console.log(req.body)
res.send({
replies: [{
type: 'quickReplies',
content: {
title: 'Sorry, but I could not find any results for your request :(',
buttons: [{ title: 'get quiz', value: 'quiz' }],
},
},)
})
app.post('/errors', (req, res) => {
console.log(req.body)
res.send()
})
app.listen(port, () => {
console.log('Server is running on port 5000')
})