B
B
bernex2016-01-21 17:36:52
JavaScript
bernex, 2016-01-21 17:36:52

Is there a bridge library between Node.js and Javascript in the browser?

There is a library that organizes a permanent, code-directed connection.

What I want to do:
I need to get the data of the directory, then get, depending on the data, the data of several sub-directories.

In the http request model, this will be 2+ requests and rendering delays.
In the local application model, there will be direct access to data (essentially a server).
With modern technology and sockets, it would be possible to reduce these gaps by making everything transparent.

What options are there to make the exchange of data between the database and the browser the most "direct"?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Anveed, 2016-01-21
@Anveed

If you use angular, look at the Restangular library, it might suit you.

A
Anton, 2016-01-21
@SPAHI4

The most direct data exchange will be in Meteor
. And for normal nodejs, any library for rest api will do. I use koa

D
Dark Hole, 2016-01-29
@abyrkov

And what do you need? JSON normal is no good?

A
Alexey Shashenkov, 2018-05-10
@teknik2008

Alternatively, use graphql. You from the front will have a complete scheme of models on the server. Further it is possible to make by the coordinated naming to make api on the client. For example, there is a User model and it has a standard set of methods (CRUD) and call all query and mutation with the appropriate names.
User_create
User_find
User_update
User_remove.
From the front, create a type parser into an object and get a type model

...,
User:{
  create(create_args){},
  find(find_args){},
  update(update_args){},
  delete(delete_args){},
},
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question