Skip to content

Commit 9f1e8a5

Browse files
committed
Get apis.host working with the new node version
1 parent e0b1d0c commit 9f1e8a5

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

config/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"host": {
3-
"url": "http://apis.host"
3+
"url": "http://www.apis.host"
44
},
55
"mock": {
66
"url": "http://www.mock.tools"

lib/generate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ exports.swagger = true;
22
exports.login = false;
33

44
exports.run = function(config, info) {
5-
console.log(info.swagger);
5+
console.log(JSON.stringify(info.swagger, undefined, 2));
66
};

lib/host.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ exports.login = true;
1212
exports.run = function(config, info) {
1313
console.log('Uploading Swagger file...');
1414

15-
request.post(config.host.url + '/save.php', {
15+
request.post(config.host.url + '/', {
1616
'form': {
1717
'swagger': JSON.stringify(info.swagger),
18+
'cli': 1,
1819
}
19-
}, function(err, res, data) {
20-
console.log(err, data);
20+
}, function(err, res, url) {
21+
console.log("");
22+
console.log("You can now access your Swagger from the following public URL:");
23+
console.log("");
24+
console.log(" " + url);
25+
console.log("");
26+
console.log("(You can also use .yaml to get the YAML representation.)");
2127
});
2228
};

utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports.config = function(env) {
2020
exports.findSwagger = function(cb, opts) {
2121
opts = opts || {};
2222

23-
swaggerInline(['**/*.js'], { // TODO! Don't use just .js (Also... ignore node_modules, .git, etc?)
23+
swaggerInline('**/*', {
2424
format: '.json',
2525
metadata: true,
2626
}).then((generatedSwagger) => {

0 commit comments

Comments
 (0)