Skip to content

senzing-garage/serve-http

Repository files navigation

serve-http

If you are beginning your journey with Senzing, please start with Senzing Quick Start guides.

You are in the Senzing Garage where projects are "tinkered" on. Although this GitHub repository may help you understand an approach to using Senzing, it's not considered to be "production ready" and is not considered to be part of the Senzing product. Heck, it may not even be appropriate for your application of Senzing!

⚠️ WARNING: serve-http is still in development ⚠️ _

At the moment, this is "work-in-progress" with Semantic Versions of 0.n.x. Although it can be reviewed and commented on, the recommendation is not to use it yet.

Synopsis

serve-http is a command in the senzing-tools suite of tools. This command is an HTTP server application that supports requests to HTTP applications via network access.

Go Reference Go Report Card License

gosec.yaml go-test-linux.yaml go-test-darwin.yaml go-test-windows.yaml

Overview

serve-http supports the

Senzing SDKs for accessing the gRPC server:

  1. Go: g2-sdk-go-grpc
  2. Python: g2-sdk-python-grpc

A simple demonstration using senzing-tools and a SQLite database.

export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
export SENZING_TOOLS_DATABASE_URL=sqlite3://na:na@/tmp/sqlite/G2C.db
senzing-tools init-database
senzing-tools serve-http --enable-all

Then visit localhost:8261

Install

  1. The serve-http command is installed with the senzing-tools suite of tools. See senzing-tools install.

Use

export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
senzing-tools serve-http [flags]
  1. For options and flags:

    1. Online documentation

    2. Runtime documentation:

      export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
      senzing-tools serve-http --help
  2. In addition to the following simple usage examples, there are additional Examples.

Using command line options

  1. ✏️ Specify database using command line option. Example:

    export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
    senzing-tools serve-http \
        --database-url postgresql://username:password@postgres.example.com:5432/G2 \
        --enable-all
    
  2. Visit localhost:8261

  3. Run senzing-tools serve-http --help or see Parameters for additional parameters.

Using environment variables

  1. ✏️ Specify database using environment variable. Example:

    export LD_LIBRARY_PATH=/opt/senzing/g2/lib/
    export SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2
    export SENZING_TOOLS_ENABLE_ALL=true
    senzing-tools serve-http
  2. Visit localhost:8261

  3. Run senzing-tools serve-http --help or see Parameters for additional parameters.

Using Docker

This usage shows how to initialze a database with a Docker container.

  1. This usage specifies a URL of an external database. Example:

    docker run \
        --env SENZING_TOOLS_DATABASE_URL=postgresql://username:password@postgres.example.com:5432/G2 \
        --env SENZING_TOOLS_ENABLE_ALL=true \
        --interactive \
        --publish 8261:8261 \
        --rm \
        --tty \
        senzing/senzing-tools serve-http
    
  2. Visit localhost:8261

  3. See Parameters for additional parameters.

Parameters

References

  1. Command reference
  2. Development
  3. Errors
  4. Examples