Skip to content

Commit a8ef8d0

Browse files
committed
making it use local data
1 parent 5f80fc9 commit a8ef8d0

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ local.log
4040
/.node_modules.ember-try/
4141
/bower.json.ember-try
4242
/package.json.ember-try
43+
44+
/ember-api-docs-data/

app/adapters/application.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { pluralize } from 'ember-inflector';
66
import { isBlank } from '@ember/utils';
77

88
export default class Application extends JSONAPIAdapter {
9-
host = ENV.API_HOST;
9+
// host = ENV.API_HOST;
1010
currentProject = '';
1111
currentProjectVersion = '';
1212

@@ -47,7 +47,7 @@ export default class Application extends JSONAPIAdapter {
4747

4848
async findRecord(store, { modelName }, id) {
4949
let url;
50-
let host = this.host;
50+
// let host = this.host;
5151
let projectName = this.currentProject;
5252

5353
if (['namespace', 'class', 'module'].indexOf(modelName) > -1) {
@@ -85,7 +85,7 @@ export default class Application extends JSONAPIAdapter {
8585
throw new Error('Unexpected model lookup');
8686
}
8787

88-
url = `${host}/${url}.json`;
88+
url = `/${url}.json`;
8989

9090
let response = await fetch(url);
9191
let json = await response.json();

ember-cli-build.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,10 @@ module.exports = function (defaults) {
6666
include: ['mappings.json'],
6767
destDir: '/assets/',
6868
});
69-
return mergeTrees([app.toTree(), mappingsTree]);
69+
70+
let docsJsonTree = new Funnel('ember-api-docs-data', {
71+
include: ['**/json-docs/**', '**/rev-index/**'],
72+
});
73+
74+
return mergeTrees([app.toTree(), mappingsTree, docsJsonTree]);
7075
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"test": "tests"
1414
},
1515
"scripts": {
16+
"clone": "rm -rf ember-api-docs-data && git clone https://github.com/ember-learn/ember-api-docs-data.git",
1617
"build": "ember build --environment=production",
1718
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
1819
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",

0 commit comments

Comments
 (0)