Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http/REST support #8

Closed
mcollina opened this issue Sep 4, 2014 · 4 comments
Closed

http/REST support #8

mcollina opened this issue Sep 4, 2014 · 4 comments

Comments

@mcollina
Copy link
Contributor

mcollina commented Sep 4, 2014

so, we need to support HTTP and REST to some extent.

What I think is:

var graftHttp = require('graft/http');
http.createServer(graftHttp);

// or with connect

connect.use(graftHttp);

This will create messages with these properties:

  • req, the actual readable stream
  • res, the actual writable stream
  • headers
  • statusChan, Readable channel that can be used to change the status code.

What do you think?

@AdrianRossouw
Copy link
Contributor

I like the idea. It could be the basis of a pretty good migration path for wayfin/waif too.

it would need to have some semantics, like constructing a message with a path, or url.
It could be pretty easily configurable to publish all messages through a single end point,
or map to proper REST based on a through stream.

We could possibly use server sent events too somewhere, but eh.

I ran into a bunch of issues with request though, but i have recently had wreck recommended to me.

@ahdinosaur
Copy link

if you're not aware already: jshttp and pillarjs are module ecosystems that will be the underlying building blocks of the next release of express, so might be quite useful here.

@mcollina
Copy link
Contributor Author

@ahdinosaur Definitely thanks! For now I'm looking to have a very thin HTTP/rest thing, hopefully with express/compatibility. Moreover you guys already wrote all those nice modules for http routing :).

@AdrianRossouw
Copy link
Contributor

we have the graft-http project now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants