Skip to content

Commit

Permalink
support running the devdocs provider on the web (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs authored Jul 31, 2024
1 parent 7f2e5dc commit 47ada61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion provider/devdocs/devdocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export async function fetchIndex(devdocsURL: string): Promise<Index> {
}

// Transform path of baseURL from /{slug}/ to /docs/{slug}/index.json
const indexURL = new URL(`/docs${baseURL.pathname}index.json`, baseURL)
const indexURL = new URL(`${baseURL.pathname}index.json`, baseURL)
indexURL.host = 'documents.devdocs.io' // this subdomain allows cross-origin requests
const response = await fetch(indexURL.toString())
const index = JSON.parse(await response.text())

Expand Down

0 comments on commit 47ada61

Please sign in to comment.