Updated API docs to fix documentation errors on github pages which is the target of the documentation. The main culprit was not having cors enabled to handle the same origin policy of the browsers. With the koa-cors package now enabled this will work perfectly.

This commit is contained in:
Mark Beamer Jr 2018-04-08 02:13:27 -04:00
parent 7d55981ad8
commit 47890ad56e
8 changed files with 11 additions and 424 deletions

View file

@ -3,11 +3,11 @@
"version": "0.0.1",
"description": "Lighthouse - Next-gen search api for LBRY",
"title": "Lighthouse API DOCS",
"url" : "http://localhost",
"sampleUrl": "http://localhost",
"url" : "http://lighthouse.lbry.io",
"sampleUrl": "http://lighthouse.lbry.io",
"json_body": true,
"template": {
"withCompare": true,
"withGenerator": true
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,21 +1 @@
define({
"name": "Lighthouse",
"version": "0.0.1",
"description": "Lighthouse - Next-gen search api for LBRY",
"title": "Lighthouse API DOCS",
"url": "http://localhost",
"sampleUrl": "http://localhost",
"json_body": true,
"template": {
"withCompare": true,
"withGenerator": true
},
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-09-28T20:35:05.906Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
});
define({ "name": "Lighthouse", "version": "0.0.1", "description": "Lighthouse - Next-gen search api for LBRY", "title": "Lighthouse API DOCS", "url": "http://lighthouse.lbry.io", "sampleUrl": "http://lighthouse.lbry.io", "json_body": true, "template": { "withCompare": true, "withGenerator": true }, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2018-04-08T06:08:09.948Z", "url": "http://apidocjs.com", "version": "0.17.6" } });

View file

@ -1,21 +1 @@
{
"name": "Lighthouse",
"version": "0.0.1",
"description": "Lighthouse - Next-gen search api for LBRY",
"title": "Lighthouse API DOCS",
"url": "http://localhost",
"sampleUrl": "http://localhost",
"json_body": true,
"template": {
"withCompare": true,
"withGenerator": true
},
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-09-28T20:35:05.906Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
}
{ "name": "Lighthouse", "version": "0.0.1", "description": "Lighthouse - Next-gen search api for LBRY", "title": "Lighthouse API DOCS", "url": "http://lighthouse.lbry.io", "sampleUrl": "http://lighthouse.lbry.io", "json_body": true, "template": { "withCompare": true, "withGenerator": true }, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2018-04-08T06:08:09.948Z", "url": "http://apidocjs.com", "version": "0.17.6" } }

0
docs/utils/send_sample_request.js Normal file → Executable file
View file

View file

@ -33,6 +33,7 @@
"gendoc": "apidoc -i server/ -o docs/"
},
"dependencies": {
"@koa/cors": "^2.2.1",
"app-root-path": "^2.0.1",
"babel-polyfill": "^6.5.0",
"bitcoin-promise": "filipnyquist/node-bitcoin-promise#1fbf1cb8913ca3542b66060d48ebea185661e0a7",

View file

@ -1,4 +1,5 @@
import bodyParser from 'koa-bodyparser';
import cors from '@koa/cors';
import Koa from 'koa';
import logger from 'koa-logger';
import helmet from 'koa-helmet';
@ -16,7 +17,8 @@ const app = new Koa();
app
.use(logger())
.use(bodyParser())
.use(helmet());
.use(helmet())
.use(cors());
routing(app);