access my app engine endpoint from javascript - javascript

How do I access my own app-engine endpoint from javascript? Any short example? I am working on an android app and add AppEngine to it as a module. Now I want to add a web-client. How do I access my AppEngine server from javascript?

See the documentation for using the Endpoints frameworks from JavaScript.

Related

Nodejs + API Rest Structure

I have a legacy system that provides an api with some queries in rest/json (Delphi) in which I will need to consume this data already available.
Then build an app using angular + nodejs, and I would like my application (client) to communicate only with my web-server on nodejs, and the web-server nodejs communicate with api, I will try to explain.
MyApp -> web-server NodeJS -> api rest legacy
client -> (web-server NodeJS port 80) -> (api rest/json server port 21000)
Any suggestions on how to put this structure together ?? Any help will be eternally grateful.
Thank you
I think that you can definitely do this task without too much trouble, I just hope that I can give you the information that you are looking for. (Please ask so I can update my answer for any more details).
Within NodeJS, you can setup an API pretty easily by using the ExpressJS framework. There are a number of tutorials, as well as documentation online to get started with that. You can create an API endpoint in your node app for each endpoint that your Delphi application has, or just create an API for the endpoints that you will need for your angular app, depends on how in depth you need it to be.
Within each endpoint in your node app, you will essentially want to forward the request to the Delphi app. I suggest looking into the Axios library, which is a promise based request library that you can use. You can extract the parameters that were provided from AngularJS, and simply add those same parameters to your request to the Delphi app.
Finally, based on the response from axios, you will want to return that data to your AngularJS.
I can provide links to examples or code snippets if need be, but I am assuming you already have familiarity with AngularJS and NodeJS, and you just wanted to see a potential system flow. Hopefully this helps.

Ionic 2 with WooCommerce API

I am having problems in handling GET/POST requests with WooCommerce API in Ionic 2. Can anyone suggest a way how to do it?
I have tried it using code from this link: https://forum.ionicframework.com/t/woocommerce-api-npm-implementation/49753/7
But it shows a runtime error of OAuth Not Defined.
You can use woocommerce-api which has already implemented all what you need to authenticate and use the WooCommerce Rest API but since it is a Node.js module that was meant to be used in a Node.js environment and not inside the browser you need first to transform it to a browser library with browserify .Here is a tutorial to build an Ionic 2 app for WooCommerce using woocommerce-api package
Add this.
declare OAuth: any ;
use https://www.npmjs.com/package/woocommerce-api
It is a Node.js wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library.
I think by using this package and some setup on the server, you can easily connect your application to the server

Google Cloud Datastore REST API from a browser

I search if it's possible and how calling Google Cloud Datastore REST API
from a browser with JavaScript.
I know this is possible from Node.js :
https://cloud.google.com/datastore/docs/reference/libraries#client-libraries-install-nodejs
But I don't find any example how to do that from a React.js or Angular application.
My application is not critical and I don't want to create fat Java endpoint in my back-end.
I believe this is what you are looking for -
https://cloud.google.com/datastore/docs/reference/rest/

LDAP authentication for a HTML/JavaScript application

I am building a HTML/JavaScript application using AngularJS. It doesn't have a backend except some Perl scripts that spit JSON through a URL through which I display the data. One of the pages on this dashboard needs privileged access for which I had to add LDAP authorization.
The application is deployed on a WAMP server. Active directory is being used in the organization; but I am not quite sure how to establish the authentication in a pure html application without a backend. What is the usual process followed to handle such authorizations and how to achieve it?
You should write a web service (REST) in any language you want (JAVA C# PHP Node.js ...) who autenticate against your Open LDAP server and you'll consume it in AngularJS.
It's quite a classic problem.
Appears to be a perfect candidate for OpenID Connect. Use one of the many available libraries available.

Is it possible to access EWS managed API from javascript

I want to create a web application, using html and JS, and I will be accessing EWS managed API. So can we access EWS API via javascript or any other language?
If yes how to do so?
If anyone still looking for JavaScript version, I am author of ews-javascript-api at https://github.com/gautamsi/ews-javascript-api, this is functional and have many operations supported. mostly most common calls. open issue at GitHub for anything not implemented I usually take next weekend to publish that feature in npm if not complex.
Published as npm ews-javascript-api
Due to Exchange CAS server CORS limitation (HTTP OPTIONS verb not implemented) you can not use it in browser. Node.js works fine. You can also use it in Electron (Atom Shell) or in NW.JS (Node-WebKit)
Support Office 365 and on-prem Exchange, all version supported by ews-managed-api (official repo).
Supported Authentication mechanism:
Basic (provide HTTPS url when calling)
Kerberos (with provided sample link in readme)
Cookies with ISA/TMG (with provided sample link in readme)
The EWS Managed API is a .NET wrapper around the EWS API (SOAP and POX Web Services).
If you're using a .NET language such as C# then you should use the EWS Managed API on the server-side and create your own JSON services (I recommend ASP.NET Web API) for your client-side JavaScript to call.
If you're only using JavaScript, you may be able to use node-soap to call the EWS SOAP services.

Categories