elasticsearch client cant be use in vue.js, because of no nodejs environment - vue.js

I tried to use elasticsearch client in vue.js. But elasticseach needs to be in a node.js environment. Vue.js doesn't have node.js environment. Is there any other solution?
https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html

You have to create a rest api an server site.
This Node.js porgramm will create the Connection to elasticsearch Server.
Your vue.js Client Connect you Rest api by ajax call.
You Node.js Programm call elasticesearch.

Related

Is there a way to proxy api calls in production

I have a vue.js frontend and I need to make api calls to an external api which doesn't allow cross-origin.
Is there a way to proxy this in the vue frontend, in development I used a devServer proxy and this worked. I could always forward it through my own spring backend but this seems like a worse solution then just proxy in the fontend.
You can't do it in production, proxy through bachend server seems right solution for you.
Also you can do a lot of stuff, like caching answers from external api, working with data immediately, without additional frontend work. Just try to do it.
If i were you, i'd just create/add separate service on backend that should work with that api.

Electron as a local API server responding to http requests?

I have a an electron app that renders a visualization. I need to have a different local application send an http request with parameters to my electron app which will then return a png or svg image based on the parameters. Can electron respond to external http API requests out of the box or do I need to integrate an express server within my app that will allow this? Having trouble finding documentation about this.
Electron does not have any built in modules for creating HTTP APIs.
However, both Electron processes (the main process as well as renderer processes) are Node processes, which means you have access to all Node APIs, including http - so you can build servers just as you would with Node. express would certainly make it easier.

Expose HTTP GET API in GraphQL Apollo Server v2.0

I am using Apollo Server v2.0 (without middleware) as part of my project and I would like to add support for a HTTP GET endpoint to for file downloads. Is there a way to expose an API endpoint without using apollo-server-express?
Thank you
No. While apollo-server currently uses express under the hood, the Express instance is not exposed as a property on the ApolloServer instance. In order to expose any additional endpoints, you'd need to migrate to apollo-server-express or any of the other available framework integrations. The migration is relatively painless since the APIs are almost identical.

Is there a possibility to use gRPC in Nuxt.js?

Im using Nuxt.js to build a frontend for some data I pull from a REST API. Now I need to call functions on a remote service, ideally via gRPC since the service has a endpoint for that.
I searched the web but I guess Im misunderstanding the whole process of creating a frontend with nuxt, since I cant find any information on that topic.
How can I, for example embed the solution provided here: https://github.com/grpc/grpc-node into my frontend?
nuxt is frontend. and the lib you are linked for backend. Nuxt dont care how you get your date, e.g. grpc or rest or anything. You need to use grpc javacsript client that work in browser e.g. https://github.com/grpc/grpc-web

Backend in Nuxt + Electron app

I use nuxe in electron application...
I use VUEX and I need to make a copy of the local data on the server (well, download them from the server on request). Which approach to use for requests to the server application of the ELECTRON? I so understand it is necessary to think over well system of authorization and so on?