This is an example serverless function (tested on Netlify Functions) that you could call from their frontend application to retrieve results from Impala REST API.
ℹ️ Please see below, a reference architecture for one of the secure ways of calling Impala APIs(any external APIs, for that matter) from your frontend application.
❌ NEVER STORE YOUR CREDENTIALS ON CLIENT SIDE.
- Store your credentials server side. Fetch the API response to any external API from this endpoint and then pass them to the frontend.
- For ease, you can build a lean endpoint on any preferred serverless offerings like AWS lambda, Azure/Google/Vercel Functions
- For web apps, all the frontend code is visible on browser. By storing your API credentials on client side, your credentials are exposed and open to being compromised.
- For mobile apps, one could reverse engineer your app on the device and find your credentials