New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Where is it installed if i wanted to make changes in the API #25
Comments
If I am not wrong - I understand the question as programmatic use of Xmysql where one can have methods to override or have hooks before/after for each API. This is something which is being considered in the future releases. |
@o1lab I've been thinking about this because I want to perform some backend input validation on the fields before xmysql includes them in a query. Did you have a potential implementation for the hooks? Would we have to write these in a separate JS file to be referenced by xmysql? One possible workaround that doesn't involve any xmysql development is to have two backend layers: validation and xmysql. Validation layer receives HTTP requests from front end, checks the input data against certain business rules to make sure it will be a valid query, and then sends the request to the xmysql server to execute the query. Another solution would be to make xmysql a library we can use inside our own Node app to generate an instance of a xmysql class and use its methods. This would allow the backend server to receive a request from the frontend, run some checks on the input fields according to business rules, and then call some xmysql methods to alter the database. This would simplify the backend architecture in comparison to my other suggestion. Here's the general idea:
postPrecheck() would be filled out by the user. It's a work in progress, but wanted to share my thoughts. |
@clancye please refer to auth issue which is open. Im addressing it there in future. |
I understand this : |
Currently, xmysql is not generating code in any files. Its all within data structures in memory. @clancye : sorry I could not come back other day completely as I was on mobile. I am reconsidering some aspect to give hooks given how easy it is now to just run xmysql as docker. Having apis in files makes it easy to develop on. I would be happy to keep both if possible. Any suggestions from docker point of view and hooks are welcome. |
Regarding the comment of @karelnet and @o1lab his answer: But now I do not quite understand the answer. Will there (maybe) be a feature in te future to only generate code instead of immediately running the express server so I can use it as a starting point for further developement? Or maybe there is already something else that makes this possible? |
Where are the files installed on the server if i wanted to make changes in the API
The text was updated successfully, but these errors were encountered: