core icon indicating copy to clipboard operation
core copied to clipboard

REST API wrapper for the processor

Open tdoan2010 opened this issue 3 years ago • 0 comments
trafficstars

Description

This pull request provides the REST API wrapper for the processor. Instead of "one-shot mode", the processor now can be started as a server. There are 2 ways to start the processor:

1. Use processor name. This is the recommended way to start the Pythonic processor as a server.

# Syntax
<processor-name> --address=IP:PORT:MONGO_URL

# Example
$ ocrd-dummy --address=0.0.0.0:80:mongodb://localhost:27017

2. Use ocrd tool. This approach is for non-Python processor.

# Syntax
ocrd processing-server <processor-name> --address=IP:PORT:MONGO_URL

# Example
$ ocrd processing-server ocrd-dummy --address=0.0.0.0:80:mongodb://localhost:27017

Options

  1. processor-name: executable name of the processor
  2. --address: it has 3 parts, separated by colon, IP:PORT:MONGO_URL, where
    1. IP: the IP address that the server should listen on.
    2. PORT: the port that the server should listen on.
    3. MONGO_URL: the full connection string to a running Mongo database instance.

tdoan2010 avatar Jul 05 '22 13:07 tdoan2010