Create cloudflare.js

This commit is contained in:
Namhyeon Go 2020-07-25 17:49:30 +09:00 committed by GitHub
parent 9f57b167b0
commit 8c7359f740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

22
lib/cloudflare.js Normal file
View File

@ -0,0 +1,22 @@
////////////////////////////////////////////////////////////////////////
// Cloudflare API
////////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell");
exports.VERSIONINFO = "Cloudflare Lib (cloudflare.js) version 0.1";
exports.global = global;
exports.require = global.require;
exports.binPath = "bin/cloudflared";
// TODO: https://developers.cloudflare.com/access/rdp/rdp-guide/
exports.installService = function() {
var commandOptions = [];
commandOptions.push(binPath);
commandOptions.push("service");
commandOptions.push("install");
return SHELL.exec(commandOptions.join(' '));
};