Example #1
0
 app.use(mount('/streaming', async function (ctx) {
   ctx.body = createReadStream(path.join(__dirname, 'stream.json'))
     .pipe(JSONStream.parse('rows.*.value'))
     .pipe(stringify())
 }))
Example #2
0
 app.use(mount('/streaming', function *() {
   this.body = fs.createReadStream(path.join(__dirname, 'stream.json'))
     .pipe(JSONStream.parse('rows.*.value'))
     .pipe(stringify())
 }))