From 36f3964f6970e6a86a0324987bca981318799170 Mon Sep 17 00:00:00 2001 From: Gregory Koberger Date: Sun, 2 Oct 2016 18:12:24 -0700 Subject: [PATCH] Quick docs example --- lib/docs.js | 17 +++++++++++++++++ lib/host.js | 6 ------ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 lib/docs.js diff --git a/lib/docs.js b/lib/docs.js new file mode 100644 index 000000000..d49669626 --- /dev/null +++ b/lib/docs.js @@ -0,0 +1,17 @@ +var request = require('request'); + +exports.swagger = true; +exports.login = true; + +exports.run = function(config, info) { + console.log('Uploading Swagger file...'); + + request.post(config.host.url + '/', { + 'form': { + 'swagger': JSON.stringify(info.swagger), + 'cli': 1, + } + }, function(err, res, url) { + console.log("https://swagger.readme.io/preview/" + new Buffer(url).toString('base64')); + }); +}; diff --git a/lib/host.js b/lib/host.js index 4ea2e582b..0d21e359c 100644 --- a/lib/host.js +++ b/lib/host.js @@ -3,12 +3,6 @@ var request = require('request'); exports.swagger = true; exports.login = true; -/* - * This will completely change 100%, and all files - * uploaded to apis.host will be removed! It's just - * a placeholder to kinda have something that works. - */ - exports.run = function(config, info) { console.log('Uploading Swagger file...');