How to Implement Security and DB connection for custom data source api (data server using Node js)?

Closed
harish asked on September 15, 2021

Hello,
We are attempting to setup custom data source api (data server using Node js) for the first time. Using SDK of node js (https://github.com/flexmonster/api-data-source). Trying to implement security and DB connection for index but not getting appropriate guidance after exploring the various related article.
Please guide us for:

  • Security implementation (setting username/password for front end request verification/CORS)
  • Creating indexes and configure to get data Object connecting and fetching from MySQL DB

 
 

3 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster September 16, 2021

Hi Harish,
 
Thank you for posting your question.
 
Please note that the Node.js server in the mentioned GitHub repository is a sample implementation of the custom data source API, not an SDK.
 
That being said, feel free to refer to it as to an example, but how you handle the security aspects and data fetching is entirely up to you.
 
As for the key features of custom data source API, this guide (and the ones it refers to) cover them in full.
 
Please let us know if this helps.
 
Best regards,
Mykhailo

Public
harish September 16, 2021

Hi Mykhailo,

Thanks, for the reply. 

Currently we are using flexmonster-data-server.exe, to provide data to frontend request.
How can we implement server filter, I was exploring the article flexmonster.com/doc/implementing-server-filter/

If I use sample .NET Core server after getting the source code from Git then, have we to implement the security aspects and data fetching?
Please suggest.
 
Warm Regards,
Harish

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster September 20, 2021

Harish,
 
Thank you for your response.
 
Please note that the mentioned documentation page about server filter implementation is relevant when using Flexmonster Data Server as a DLL, not as a console application.
 
Speaking of the sample Node.js server, it was created to work with JSON datasets and does not provide extensive security features – if you want it to connect to MySQL and handle security in any particular way, yes, you can use the source code as a base and build your own implementation on top of it.
 
Hope this helps!
 
Regards,
Mykhailo

This question is now closed