mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-08-24 06:38:42 +08:00
Serve both UI assets and REST API from handler
This commit is contained in:
@@ -5,7 +5,7 @@ import queryString from "query-string";
|
||||
// the static file server.
|
||||
// In developement, we assume that the API server is listening on port 8080.
|
||||
const BASE_URL =
|
||||
process.env.NODE_ENV === "production" ? "/api" : "http://localhost:8080/api";
|
||||
process.env.NODE_ENV === "production" ? `${window.ROOT_PATH}/api` : `http://localhost:8080${window.ROOT_PATH}/api`;
|
||||
|
||||
export interface ListQueuesResponse {
|
||||
queues: Queue[];
|
||||
|
5
ui/src/global.d.ts
vendored
Normal file
5
ui/src/global.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
interface Window {
|
||||
// Root URL path for asynqmon app.
|
||||
// ROOT_PATH should not have the tailing slash.
|
||||
ROOT_PATH: string;
|
||||
}
|
@@ -1,11 +1,11 @@
|
||||
export const paths = {
|
||||
HOME: "/",
|
||||
SETTINGS: "/settings",
|
||||
SERVERS: "/servers",
|
||||
SCHEDULERS: "/schedulers",
|
||||
QUEUE_DETAILS: "/queues/:qname",
|
||||
REDIS: "/redis",
|
||||
TASK_DETAILS: "/queues/:qname/tasks/:taskId",
|
||||
HOME: `${window.ROOT_PATH}/`,
|
||||
SETTINGS: `${window.ROOT_PATH}/settings`,
|
||||
SERVERS: `${window.ROOT_PATH}/servers`,
|
||||
SCHEDULERS: `${window.ROOT_PATH}/schedulers`,
|
||||
QUEUE_DETAILS: `${window.ROOT_PATH}/queues/:qname`,
|
||||
REDIS: `${window.ROOT_PATH}/redis`,
|
||||
TASK_DETAILS: `${window.ROOT_PATH}/queues/:qname/tasks/:taskId`,
|
||||
};
|
||||
|
||||
/**************************************************************
|
||||
|
Reference in New Issue
Block a user