fix: update server settings ref
This commit is contained in:
parent
5975237a39
commit
013c0ce36e
@ -4,7 +4,14 @@ import { WindowManager } from './../managers/window'
|
|||||||
import { getResourcePath, userSpacePath } from './../utils/path'
|
import { getResourcePath, userSpacePath } from './../utils/path'
|
||||||
import { AppRoute } from '@janhq/core'
|
import { AppRoute } from '@janhq/core'
|
||||||
import { ModuleManager, init, log } from '@janhq/core/node'
|
import { ModuleManager, init, log } from '@janhq/core/node'
|
||||||
import { startServer, stopServer } from '@janhq/server'
|
import {
|
||||||
|
startServer,
|
||||||
|
stopServer,
|
||||||
|
isCorsEnabled,
|
||||||
|
isVerboseEnabled,
|
||||||
|
getHost,
|
||||||
|
getPort,
|
||||||
|
} from '@janhq/server'
|
||||||
|
|
||||||
export function handleAppIPCs() {
|
export function handleAppIPCs() {
|
||||||
/**
|
/**
|
||||||
@ -51,8 +58,14 @@ export function handleAppIPCs() {
|
|||||||
/**
|
/**
|
||||||
* Start Jan API Server.
|
* Start Jan API Server.
|
||||||
*/
|
*/
|
||||||
ipcMain.handle(AppRoute.startServer, async (_event) =>
|
ipcMain.handle(
|
||||||
|
AppRoute.startServer,
|
||||||
|
async (_event, host, port, isCorsEnabled, isVerbose) =>
|
||||||
startServer(
|
startServer(
|
||||||
|
host,
|
||||||
|
port,
|
||||||
|
isCorsEnabled,
|
||||||
|
isVerbose,
|
||||||
app.isPackaged
|
app.isPackaged
|
||||||
? join(getResourcePath(), 'docs', 'openapi', 'jan.yaml')
|
? join(getResourcePath(), 'docs', 'openapi', 'jan.yaml')
|
||||||
: undefined,
|
: undefined,
|
||||||
@ -63,7 +76,27 @@ export function handleAppIPCs() {
|
|||||||
/**
|
/**
|
||||||
* Stop Jan API Server.
|
* Stop Jan API Server.
|
||||||
*/
|
*/
|
||||||
ipcMain.handle(AppRoute.stopServer, async (_event) => stopServer())
|
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.
|
* Relaunches the app in production - reload window in development.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user