Regrex is a API that executes grex (binary file) inside a lambda through an AWS Layer.
- Node.js ^14.15.0
- Serveless Framework
- AWS Account
npm install
Or simply:
yarn
Was installed and configured the
eslint
andprettier
to keep the code clean and patterned.
Access Grex repository page and download the linux distribution into dependencies/bin
. Then zip the dependencies
folder:
cd dependencies
zip -yr ../dependencies.zip .
cd ..
Or using 7zip:
cd dependencies
7z a ../dependencies.zip *
cd ..
For those that for any reason are not able to download the binary or compact your own package this repository is shipped with one package ready for use.
Then, deploy the API:
$ sls deploy
Refer to the Grex documentation, send the parameters and flags in the body
of the request:
{
"terms": [
"sample",
"example",
"simple"
],
"flags": ["x"]
}
Output:
(?x)
^
(?:
exa
|
s[ai]
)
mple
$
There are only a few flags not available:
- -c, --colorize
- -h, --help
- -v, --version
Jest was the choice to test the app, to run:
$ yarn test
Or:
$ npm run test
Run the command in the root folder
You can see the coverage report inside tests/coverage
. They are automatically created after the tests run.