supershabam / espress

Express-inspired web server for serving websocket streaming routes
MIT License
0 stars 0 forks source link

define api #1

Open supershabam opened 10 years ago

supershabam commented 10 years ago
app.use(espress('/espress'))
app.stream('tail', function(s) {
  s.args // Array of strings, provided by client
  s.stdin // Readable stream from client
  s.stdout // Writable stream to the client
  s.stderr // Writable stream to the client
  s.exit(0) // Sends exit code after output streams have flushed, no more data to client
})
supershabam commented 10 years ago

I don't like hijacking the "stream" name on app.

Espress may have a few different endpoints as well.

var router = new espress.Router('/espress')
router.stream('tail', function() {})
app.use(router)
supershabam commented 10 years ago

should have the concept of "env" set by the client as well.

supershabam commented 10 years ago

should be able to detect client disconnect ("ctrl-c")