init cli center
This commit is contained in:
13
cli-center/src/modules/basename.ts
Normal file
13
cli-center/src/modules/basename.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// @ts-ignore
|
||||
export const basename = BASE_NAME;
|
||||
|
||||
console.log(basename);
|
||||
|
||||
export const wrapBasename = (path: string) => {
|
||||
const hasEnd = path.endsWith('/')
|
||||
if (basename) {
|
||||
return `${basename}${path}` + (hasEnd ? '' : '/');
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
15
cli-center/src/modules/query.ts
Normal file
15
cli-center/src/modules/query.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Query } from '@kevisual/query'
|
||||
|
||||
const getUrl = () => {
|
||||
const host = window.location.host
|
||||
const isKevisual = host.includes('kevisual');
|
||||
if (isKevisual) {
|
||||
return '/api/router'
|
||||
}
|
||||
|
||||
return '/client/router'
|
||||
}
|
||||
|
||||
export const query = new Query({
|
||||
url: getUrl()
|
||||
});
|
||||
Reference in New Issue
Block a user