I created an ArangoDB Foxx service, and successfully mounted it on some route using Foxx CLI. My service has a dependency which uses randombytes. When I call the service it returns an error saying `randomBytes is not a function.
For testing purposes I have created another service and just returned typeof require('randombytes'). And it returned undefined.
During installation Foxx CLI didn't warn me anything.
Does anyone had such experience?
First, have you defined your randombytes module in your package.json dependencies ?
Then what about
Actually I just tested ... and it returns "undefined" as well ... so not sure it's a valid module for arango.
It's better to use arango's crypto methods
https://www.arangodb.com/docs/stable/appendix-java-script-modules-crypto.html#genrandomnumbers