export async function serve()

in packages/cli/src/utils/serve-predict.ts [24:40]


export async function serve(
  port: number,
  pipelineType: PipelineType,
  predictCallback: PredictCallBack
): Promise<void> {
  if (!ServeMap[pipelineType]) {
    throw new TypeError(`Pipeline type is not supported: ${pipelineType}`);
  }

  const app = express();
  ServeMap[pipelineType](app, predictCallback);
  return new Promise<void>((resolve) => {
    server = app.listen(port, () => {
      resolve();
    });
  });
}