Skip to content

Commit

Permalink
support running the devdocs provider on the web (sourcegraph#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs authored and bevzzz committed Dec 12, 2024
1 parent 33d9934 commit f326b08
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 f326b08

Please sign in to comment.