📅  最后修改于: 2020-10-30 14:11:58             🧑  作者: Mango
本节介绍如何使用CloudRail的Node.js SDK。
最简单的安装方法是通过NPM 。只需使用以下命令-
npm install cloudrail-si
以下示例显示如何创建新文件夹并将文件从本地计算机上载到任何云存储提供商上的新创建的文件夹。
javascript
const cloudrail = require("cloudrail-si");
cloudrail.Settings.setKey("[CloudRail License Key]");
// let cs = new cloudrail.services.Box(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");
// let cs = new cloudrail.services.OneDrive(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");
// let cs = new cloudrail.services.GoogleDrive(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");
let cs = new cloudrail.services.Dropbox(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");
cs.createFolder("/TestFolder", (err) => { // { //