0.10.47 • Published 3 years ago
@graphshieldhq/sidecar-js v0.10.47
GraphShield Sidecar for Node.js and Javascript
This module is an isomorphic package for Node.js and Javascript that
# Install the @graphshieldhq/sidecar-js npm package
npm install --save @graphshieldhq/sidecar-js
# Run your app with the sidecar
node --import @graphshieldhq/sidecar-js ./index.js💡 Technically you can also import the sidecar module directly from your app using standard
importstatement, but we strongly recommend to preload it using the node runtime using the--importCLI argument. Refer to the --import documentation.⚠️ Modules preloaded with
--requirewill run before modules preloaded with--import.
This technique could be applied to your package.json start script:
{
"scripts": {
"start": "NODE_ENV=production node --import @graphshieldhq/sidecar-js ./index.js",
}
}Or to the ENTRYPOINT / CMD of your Dockerfile:
CMD ["node", "--import", "@graphshieldhq/sidecar-js", "./index.js"]💡 By default, GraphShield sidecar modules are redirecting requests to
proxy.graphshield.io. to learn more about its configuration options.
0.10.47
3 years ago