Code Monkey home page Code Monkey logo

Comments (4)

tamagokun avatar tamagokun commented on July 1, 2024

Working on the client today. Thoughts on implementation?

Not sure if we want an http client that can speak micro services, or a micro services client that can transport over http.

// send http request stream to micro service?
var req = graftHttp.client("localhost:3000/posts/15", {method: "GET"});
req.on('data', function(msg) {
  console.log(msg);
});

// write message to micro service?
var res = graft.ReadChannel();
graft.pipe(graftHttp.client({port: 3000}));

graft.write({
  path: "/posts/15",
  res: res
});

res.on('data', function(msg) {
  console.log(msg);
});

from graft-http.

mcollina avatar mcollina commented on July 1, 2024

I think we should have two modules: a graft-http-server and a graft-http-client. They serve two completely different use cases:

  • graft-http-server is for letting other consume REST services provided by Graft.
  • graft-http-client is for consuming external REST services with Graft.

from graft-http.

tamagokun avatar tamagokun commented on July 1, 2024

two modules as in separate files or separate npm packages?

I think I understand now. So you send the request and you get back a message to be consumed with graft.

from graft-http.

mcollina avatar mcollina commented on July 1, 2024

two modules as in separate files or separate npm packages?

You decide.

So you send the request and you get back a message to be consumed with graft.

The main point here is interoperability. If it is graft <-> graft other transports are better suited for the task, as we cannot send channels over REST. However, we want to be interoperable with the rest of the world!

from graft-http.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.