I have a basic idea on how to do it: We could check if there are search operators in the req.query.kata parameter received on the endpoint /cariGunaKata. If there is, we can tokenise the parameter and from there, we can analyse it and perform the request as intended.
If there are no search operators, then return the result as usual.
Tests
Admittedly, tests are very scarce. So I would appreciate if you can write some tests. I'll update more once I have a testing framework set up (I'll most probably use Jest).
Overview
If you've used search operators in Google, you know what this feature is about. If not, here's a good article that talks about it: Google Search Operators: The Complete List (44 Advanced Operators).
How to build it?
I have a basic idea on how to do it: We could check if there are search operators in the
req.query.kata
parameter received on the endpoint/cariGunaKata
. If there is, we can tokenise the parameter and from there, we can analyse it and perform the request as intended.If there are no search operators, then return the result as usual.
Tests
Admittedly, tests are very scarce. So I would appreciate if you can write some tests. I'll update more once I have a testing framework set up (I'll most probably use Jest).