From 60a8450d34d138f3426cc81262d7f4fe6e174740 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 17 Jan 2024 12:07:08 +0700 Subject: [PATCH] chore: remove unused apis --- core/src/api/index.ts | 4 ---- electron/handlers/app.ts | 29 +---------------------------- server/index.ts | 24 ------------------------ 3 files changed, 1 insertion(+), 56 deletions(-) diff --git a/core/src/api/index.ts b/core/src/api/index.ts index ef41d7028..3cf70a105 100644 --- a/core/src/api/index.ts +++ b/core/src/api/index.ts @@ -12,10 +12,6 @@ export enum AppRoute { baseName = 'baseName', startServer = 'startServer', stopServer = 'stopServer', - isCorsEnabled = 'isCorsEnabled', - isVerboseEnabled = 'isVerboseEnabled', - getHost = 'getHost', - getPort = 'getPort', log = 'log' } diff --git a/electron/handlers/app.ts b/electron/handlers/app.ts index ae4e31b73..5af222d64 100644 --- a/electron/handlers/app.ts +++ b/electron/handlers/app.ts @@ -4,14 +4,7 @@ import { WindowManager } from './../managers/window' import { getResourcePath, userSpacePath } from './../utils/path' import { AppRoute } from '@janhq/core' import { ModuleManager, init, log } from '@janhq/core/node' -import { - startServer, - stopServer, - isCorsEnabled, - isVerboseEnabled, - getHost, - getPort, -} from '@janhq/server' +import { startServer, stopServer } from '@janhq/server' export function handleAppIPCs() { /** @@ -78,26 +71,6 @@ export function handleAppIPCs() { */ ipcMain.handle(AppRoute.stopServer, stopServer) - /** - * Check if CORS is enabled. - */ - ipcMain.handle(AppRoute.isCorsEnabled, isCorsEnabled) - - /** - * Check if verbose logging is enabled. - */ - ipcMain.handle(AppRoute.isVerboseEnabled, isVerboseEnabled) - - /** - * Get the host setting. - */ - ipcMain.handle(AppRoute.getHost, getHost) - - /** - * Get the port setting. - */ - ipcMain.handle(AppRoute.getPort, getPort) - /** * Relaunches the app in production - reload window in development. * @param _event - The IPC event object. diff --git a/server/index.ts b/server/index.ts index 655fc8f80..70d43f482 100644 --- a/server/index.ts +++ b/server/index.ts @@ -133,27 +133,3 @@ export const stopServer = async () => { if (isVerbose) log(`[API]::Error: ${e}`); } }; - -/** - * Function to check if CORS is enabled - * @returns - True if CORS is enabled, false otherwise - */ -export const isCorsEnabled = () => corsEnbaled; - -/** - * Function to check if verbose logging is enabled - * @returns - True if verbose logging is enabled, false otherwise - */ -export const isVerboseEnabled = () => isVerbose; - -/** - * Function to get the host setting - * @returns - The current host setting - */ -export const getHost = () => hostSetting; - -/** - * Function to get the port setting - * @returns - The current port setting - */ -export const getPort = () => portSetting;