suyanhanx commented on code in PR #2082:
URL:
https://github.com/apache/incubator-opendal/pull/2082#discussion_r1174548736
##########
bindings/nodejs/examples/README.md:
##########
@@ -0,0 +1,42 @@
+# OpenDAL Node.js examples
+
+## s3 example
+
+```javascript
+import { Operator } from "opendal";
+
+async function main() {
+ // you can try to config Operator in the following two ways
+ // 1. config Operator plainly
+ const op = new Operator("s3", {
+ root: "/test_opendal",
+ bucket: "your bucket name",
+ region: "your bucket region",
+ endpoint: "your endpoint",
+ access_key_id: "your access key id",
+ secret_access_key: "your secret access key",
+ });
+
+ // 2. Or config Operator from .env, opendal will load from the environment
by default
+ const endpoint = process.env.AWS_S3_ENDPOINT;
+ const region = process.env.AWS_S3_REGION;
+ const accessKeyId = process.env.AWS_ACCESS_KEY_ID;
+ const secretAccessKey = process.env.AWS_SECRET_ACCESS_KEY;
+ const bucket = process.env.AWS_BUCKET;
Review Comment:
It doesn't need to extract them here. We should just use some tools for
injecting environment variables, such as `dotenv`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]