Hierarchy

  • RequestHandlers

Constructors

Properties

mainWindow: BrowserWindow

Methods

  • Handle the requests to /compile endpoint. The request is processed via electron IPC messages:

    • A message is sent to the frontend, specifying the source (i.e. the endpoint) and the request content

    Parameters

    • req: any

      request

    • res: any

      response

    Returns void

    Example

    {
    'path':'/api/v1/compile',
    'content': {
    'field0':'content0',
    'field1': {
    'field2':'content2'
    }
    }
    }
    • An ipcMain listen for frontend messages (as a response, containing errors for instance) and processes it returning an HTTP response
  • Handle the requests to /read endpoint. The request is processed via electron IPC messages:

    • A message is sent to the frontend, specifying the source (i.e. the endpoint) and the request content
    • An ipcMain listen for frontend messages (as a response) and processes it returning an HTTP response togheter with its content

    Parameters

    • req: any

      request

    • res: any

      response

    Returns void

  • Sends a message to the frontend from inside to a REST endpoint, the message content depends on the endpoint parameters and on the client (i.e. who called the endpoint) request.

    Parameters

    • mainWindow: any

      electron main window

    • path: any

      endpoint path

    • Optional content: any

    Returns void

  • Sends the frontend message to the client who called the REST endpoint, and based on the frontend message it returns an appropriate HTTP response.

    Parameters

    • message: any

      the frontend message (response to a previous request)

    • reqName: any

      a code that specify the frontend message 'type' (@example if the frontend message is a consequence of a previous /compile or /read request)

    • onSuccess: any

      callback for succesfull operation

    • onError: any

      callback for errors

    Returns void

Generated using TypeDoc