Comments (4)
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graft-http.