Using AWS SDK directly in client app instead of api gateway - aws-sdk

I have one funny but strange question.
As you know we can use aws-sdk directly in react native or react js app.
It means we can execute all DynamoDB SDK commands from react native/js app.
so if table is already created in dynamodb either by console or any framework, we can use aws-sdk from client app to directly put item in dynamodb table instead of calling the api gateway & telling lambda to use aws-sdk to put item in dynamodb.
let me know what are cons for it & if this is even feasible or not.

Related

Connect to MySQL using Ionic Framework without api layer

Is it possible to connect to a MySQL database directly from an Ionic application without an integration/api layer?
All the answers I found online suggest to create API in php or nodejs, but I would like to develop a sql client and the whole point of the application is to be able to make queries directly from the client device.
I cannot use the node mysql library from client side.
I am using Ionic 6 React.
No, as noted by Mostafa Harb, you cannot directly access a MySQL database in the cloud from a device. You'll need to use some kind of API.
The basic flow:
Ionic app authenticates to the API if necessary.
Ionic app uses Axios or Fetch to use the API to query the cloud database.
The API returns the response in a format the Ionic app understands.
The good thing about Ionic is that it is mostly framework-agnostic, so you can use any API you like.
Personally, I use Drupal, which is a PHP-based CMS that has support for providing access to Ionic via REST, JSON:API, or GraphQL (or a mix of the three).

Connect to existing browser using Playwright for .Net

We have a single Asp Core API method that is transforming provided html into PDF using headless Chromium. Currently the API method is using Puppeteer, which connects to an existing instance of Chromium using the debugging port and generates the PDF. Chromium needs to be launched before or on application start. All this works fine.
We are now considering rewriting the API to use Microsoft.Playwright instead of the Puppeteer. However, it seems that with Playwright for .Net we can't connect to an existing browser instance and we always need to use BrowserType.LaunchAsync, which creates a new instance. I can see the BrowserType.Connect available for all other APIs (node, python, java) but not for .Net.
Is there a way to avoid launching a new browser for every API request using the .Net Playwright API? It is very time-consuming and performance is very important in our case.

Shared library between UWP and REST api

I have a REST service that has many commands that can be called to return JSON data. I have a library of the DTO's that I use to build this JSON. I want to reference this library in my UWP app so that I can ensure they decode correctly. However I cannot reference the dll in my UWP app. I tried the backwards approach too, adding a UWP library to my REST service and referencing it in my UWP app, however then I cannot refrence it in the REST API. Any suggestions?
Move all your DTO's to a class library built using .Net Standard 1.4
This will allow you to share code between your REST service and UWP app.

How are rest api created using swagger distributed

I understand that creation of Rest api documentation using swagger Ui generates a few jsons
Do other developers need to use swagger UI installation on their laptop to view these ?
What is the best way to view such a documentation
The general way is to host your own swagger ui instance on your servers, exposing the REST documentation. When all fails, and assuming you've enabled CORS, you can use the online petstore and paste the URL to you Swagger there.

How to send apprequest using actionscript without FB.ui or PHP?

I am building an App in Flash using graph API, I would like to post a request to increase count next to the app bookmark (as detailed here: http://developers.facebook.com/docs/requests/), all the documentation refer to either:
server-side (PHP SDK) where there is no problem using the 'app secret' to retrieve app_access_token, or
using FB.ui which requires user interaction, which is not what I am trying to do.
Is there a way to send an apprequests (App to User) via JS SDK only?
Could it be that this feature does not work in sandbox mode?
UPDATE: solved. worked it out.
I use the server to retrieve the app_access_token (only for a valid logged in user), once having app_access_token there is no problem using standard api calls from within flash.
UPDATE: solved. worked it out.
I use the server to retrieve the app_access_token (only for a valid logged in user), once having app_access_token there is no problem using standard api calls from within flash.