Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Commit

Permalink
update(🚚): improve readability in mirage file
Browse files Browse the repository at this point in the history
  • Loading branch information
osamaqarem committed Jun 18, 2020
1 parent 7c07a84 commit a1ac6e9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions template/src/services/network/mock/mirage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ import { githubService } from "../github/githubService"
*/
export const makeMirage = () =>
new Server({
urlPrefix: BuildConfig.EXAMPLE_API_BASE_URL,
routes() {
urlPrefix: BuildConfig.GITHUB_API_BASE_URL,
routes: function () {
// Logging
; (this.pretender.handledRequest = function (verb, path, request) {
console.tron(`${verb}: ${path}`, request)
}),
this.get(
githubService.paths.getRepoReadme(),
(): RepoReadme => mockResponse
)
console.log(`${verb}: ${path}`, request)
})

this.get(
githubService.paths.getRepoReadme(),
(): RepoReadme => mockResponse
)
},
})

Expand All @@ -31,7 +33,7 @@ const mockResponse = {
"git_url": "https://api.github.com/repos/osamaq/react-native-template/git/blobs/4ce7575b978282dbde768bd711e9e4166b244c7e",
"download_url": "https://raw.githubusercontent.com/osamaq/react-native-template/master/README.md",
"type": "file",
"content": "bW9jaw==",
"content": "TW9jayByZXNwb25zZS4gQ2hlY2sgbWlyYWdlLnRzIHRvIGVkaXQgdGhpcyE=",
"encoding": "base64",
"_links": {
"self": "https://api.github.com/repos/osamaq/react-native-template/contents/README.md?ref=master",
Expand Down

0 comments on commit a1ac6e9

Please sign in to comment.