Skip to content

Commit

Permalink
feat: change oss base url (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyantong2000 authored Sep 30, 2024
1 parent 6fbc404 commit 43ce0da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import request from '../helpers/request';

export const getMetricByName = async (owner: string, metricNameMap: Map<string, string>, metric: string) => {
try {
return await request(`${OSS_XLAB_ENDPOINT}/open_digger/github/${owner}/${metricNameMap.get(metric)}.json`);
return await request(`${OSS_XLAB_ENDPOINT}/github/${owner}/${metricNameMap.get(metric)}.json`);
} catch (error) {
// the catched error being "404" means the metric file is not available so return a null
if (error === ErrorCode.NOT_FOUND) {
Expand All @@ -17,8 +17,8 @@ export const getMetricByName = async (owner: string, metricNameMap: Map<string,

/**
* Common interface for both repo meta and user meta
* e.g. https://oss.x-lab.info/open_digger/github/X-lab2017/open-digger/meta.json (repo meta file)
* e.g. https://oss.x-lab.info/open_digger/github/tyn1998/meta.json (user meta file)
* e.g. https://oss.open-digger.cn/github/X-lab2017/open-digger/meta.json (repo meta file)
* e.g. https://oss.open-digger.cn/github/tyn1998/meta.json (user meta file)
* @param name repo name or user name
*/
export interface CommonMeta {
Expand Down Expand Up @@ -52,7 +52,7 @@ class MetaStore {
* @param name repo name or user name
*/
private fetchMeta(name: string) {
const url = `${OSS_XLAB_ENDPOINT}/open_digger/github/${name}/meta.json`;
const url = `${OSS_XLAB_ENDPOINT}/github/${name}/meta.json`;
const promise = fetch(url);
this.responseCache.set(name, promise);
}
Expand Down
2 changes: 1 addition & 1 deletion src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export enum ErrorCode {
UNKNOWN = 500,
}

export const OSS_XLAB_ENDPOINT = 'https://oss.x-lab.info';
export const OSS_XLAB_ENDPOINT = 'https://oss.open-digger.cn';

export const HYPERTRONS_CRX_NEW_ISSUE = 'https://github.com/hypertrons/hypertrons-crx/issues/new/choose';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import { RepoMeta, metaStore } from '../../../../api/common';

import React from 'react';
import { render } from 'react-dom';
import $ from 'jquery';

const featureId = features.getFeatureID(import.meta.url);
Expand Down

0 comments on commit 43ce0da

Please sign in to comment.