mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-09-25 00:13:12 +08:00
Refactor API endpoint
This commit is contained in:
parent
2505e01fce
commit
4bd1790a52
2
.gitignore
vendored
2
.gitignore
vendored
@ -20,6 +20,8 @@ frontend/npm-debug.log*
|
|||||||
frontend/yarn-debug.log*
|
frontend/yarn-debug.log*
|
||||||
frontend/yarn-error.log*
|
frontend/yarn-error.log*
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|
||||||
**/.vscode
|
**/.vscode
|
||||||
*.tgz
|
*.tgz
|
||||||
**/build
|
**/build
|
@ -1,6 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { ENVIRONMENT } from "../constants/env";
|
||||||
|
|
||||||
// No auth for the API
|
// No auth for the API
|
||||||
export default axios.create({
|
export default axios.create({
|
||||||
baseURL: "https://api.signoz.io/api/prom/api/v1",
|
baseURL: `${ENVIRONMENT.baseURL}/api/prom/api/v1`,
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { ENVIRONMENT } from "../constants/env";
|
||||||
|
|
||||||
export default axios.create({
|
export default axios.create({
|
||||||
// baseURL: 'http://104.211.113.204:8080/api/v1/',
|
baseURL: `${ENVIRONMENT.baseURL}/api/v1/`,
|
||||||
// baseURL: process.env.REACT_APP_QUERY_SERVICE_URL,
|
|
||||||
// console.log('in metrics API', process.env.QUERY_SERVICE_URL)
|
|
||||||
baseURL: "/api/v1/",
|
|
||||||
});
|
});
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { ENVIRONMENT } from "../constants/env";
|
||||||
|
|
||||||
export default axios.create({
|
export default axios.create({
|
||||||
// baseURL: 'https://api.telegram.org/bot1518273960:AAHcgVvym9a0Qkl-PKiCI84X1VZaVbkTud0/',
|
// baseURL: 'https://api.telegram.org/bot1518273960:AAHcgVvym9a0Qkl-PKiCI84X1VZaVbkTud0/',
|
||||||
// baseURL: 'http://104.211.113.204:8080/api/v1/',
|
// baseURL: 'http://104.211.113.204:8080/api/v1/',
|
||||||
baseURL: "/api/v1/",
|
// baseURL: "/api/v1/",
|
||||||
|
baseURL: `${ENVIRONMENT.baseURL}/api/v1/`,
|
||||||
});
|
});
|
||||||
|
|
||||||
//https://api.telegram.org/bot1518273960:AAHcgVvym9a0Qkl-PKiCI84X1VZaVbkTud0/sendMessage?chat_id=351813222&text=Hello%20there
|
//https://api.telegram.org/bot1518273960:AAHcgVvym9a0Qkl-PKiCI84X1VZaVbkTud0/sendMessage?chat_id=351813222&text=Hello%20there
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { ENVIRONMENT } from "../constants/env";
|
||||||
//import { format } from 'path';
|
//import { format } from 'path';
|
||||||
|
|
||||||
export default axios.create({
|
export default axios.create({
|
||||||
// baseURL: 'http://104.211.113.204:8080/api/v1/' //comment this line and remove this comment before pushing
|
// baseURL: 'http://104.211.113.204:8080/api/v1/' //comment this line and remove this comment before pushing
|
||||||
// baseURL: process.env.QUERY_SERVICE_URL,
|
// baseURL: process.env.QUERY_SERVICE_URL,
|
||||||
// console.log('in traces API', process.env.QUERY_SERVICE_URL)
|
// console.log('in traces API', process.env.QUERY_SERVICE_URL)
|
||||||
baseURL: "/api/v1/",
|
// baseURL: "/api/v1/",
|
||||||
|
baseURL: `${ENVIRONMENT.baseURL}/api/v1/`,
|
||||||
});
|
});
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
export enum MetricQueryParama {
|
|
||||||
time = "time",
|
|
||||||
}
|
|
@ -1,3 +1,3 @@
|
|||||||
export enum LocalStorage {
|
export enum LOCAL_STORAGE {
|
||||||
metricsTimeDuration = "metricsTimeDuration",
|
metricsTimeDuration = "metricsTimeDuration",
|
||||||
}
|
}
|
3
frontend/src/constants/env.ts
Normal file
3
frontend/src/constants/env.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export const ENVIRONMENT = {
|
||||||
|
baseURL: "http://104.211.113.204:8080"
|
||||||
|
}
|
3
frontend/src/constants/query.ts
Normal file
3
frontend/src/constants/query.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export enum METRICS_PAGE_QUERY_PARAM {
|
||||||
|
time = "time",
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user