Skip to content

Commit

Permalink
feat: replace knowledge-graph link with bitcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rassl committed Sep 24, 2024
1 parent d6ac658 commit 17be3d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/utils/apiUrlFromSwarmHost/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ describe('apiUrlFromSwarmHost', () => {
jest.restoreAllMocks()
})

it('returns "https://knowledge-graph.sphinx.chat/api" for the URL "https://second-brain.sphinx.chat"', () => {
it('returns "https://bitcoin.sphinx.chat/api" for the URL "https://second-brain.sphinx.chat"', () => {
mockWindowLocation('https://second-brain.sphinx.chat')
expect(apiUrlFromSwarmHost()).toBe('https://knowledge-graph.sphinx.chat/api')
expect(apiUrlFromSwarmHost()).toBe('https://bitcoin.sphinx.chat/api')
})

it('returns "https://knowledge-graph.sphinx.chat/api" for a URL containing "localhost"', () => {
it('returns "https://bitcoin.sphinx.chat/api" for a URL containing "localhost"', () => {
mockWindowLocation('http://localhost:3000')
expect(apiUrlFromSwarmHost()).toBe('https://knowledge-graph.sphinx.chat/api')
expect(apiUrlFromSwarmHost()).toBe('https://bitcoin.sphinx.chat/api')
})

it('returns the original URL appended with /api for a URL not containing "swarm" and not hardcoded', () => {
const nonSwarmUrl = 'https://knowledge-graph.sphinx.chat'
const nonSwarmUrl = 'https://bitcoin.sphinx.chat'

mockWindowLocation(nonSwarmUrl)
expect(apiUrlFromSwarmHost()).toBe(`${nonSwarmUrl}/api`)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/apiUrlFromSwarmHost/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { origin, host } = window.location

const getUrlFormEnv = () => import.meta.env.VITE_APP_API_URL

export const API_URL = getUrlFormEnv() || apiUrlFromSwarmHost() || 'https://knowledge-graph.sphinx.chat'
export const API_URL = getUrlFormEnv() || apiUrlFromSwarmHost() || 'https://bitcoin.sphinx.chat'

export function apiUrlFromSwarmHost(): string | undefined {
// for swarm deployments, always point to "boltwall"
Expand Down

0 comments on commit 17be3d4

Please sign in to comment.