0.2.1 • Published 5 years ago

@determapp/viewer-server v0.2.1

Weekly downloads
-
License
GPL-3.0
Repository
gitlab
Last release
5 years ago

DetermApp-Viewer-Server

This package allows to create and serve DetermApp viewer instances.

API

export declare function createViewerServer(manager: ProjectManager): {
    listen: (port: number, mode: "localhost" | "localnetwork") => Promise<{
        port: number;
        shutdown: () => void;
    }>;
};

// allows detecting an export
export declare const detectExport: (directory: string) => Promise<{
    projectId: string;
} | undefined>;

// exports an directory to the specified path
export declare const compileProject: ({ manager, projectId, branch, exportDirectory }: {
    manager: ProjectManager;
    projectId: string;
    branch: string;
    exportDirectory: string;
}) => Promise<void>;

// the path of the viewer archive from @determapp/viewer
export declare const viewerArchivePath: string;

Bundling

This contains @determapp/viwer. It requires the following:

When you use this package and want to bundle your application (e.g. with Webpack):

  • configure __dirname to match the path of the running script
  • copy determapp-viewer.tar.gz to the directory of the output directory.
    • you can get the path of the file with require('@determapp/viewer-server').viewerArchivePath

Commands

npm run build

  • builds this component
  • executed as prepare hook