* This adds in support to the lattice UI application to use the SQL3
endpoint. If the `/sql` endpoint returns 404, it will use the SQL1
endpoint. If the `/sql` endpoint is available, it will send SQL queries
to that. It does not try the SQL1 endpoint if the SQL3 endpoint returns
an error processing the query. That is, it is all SQL3 or SQL1.
- Below are the specific changes:
- Adds a file that contains functions for interacting with http services as opposed to just grpc/event-based services. As of this commit, it is only the SQL3 endpoint.
- This adds a variable to track if we are using the SQL3 endpoint or not
- This adds a function to handle the response from the SQL3 endpoint
- Adds a function to eventServices to query the sql3 HTTP endpoint
- Fixed a missing semicolon in grpcServices
Co-authored-by: Fletcher Haynes <fletcher.haynes@generalassemb.ly>
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| .gitignore | ||
| Caddyfile | ||
| Dockerfile | ||
| Makefile | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tslint.json | ||
| yarn.lock | ||
Connecting to a standalone Pilosa instance
Lattice can run independently (with e.g. yarn start; see below), connecting to any Pilosa instance. Pilosa must be started with the allowed-origins configuration parameter set to communicate with the UI.
CLI: pilosa server --handler.allowed-origins http://localhost:3000
You will need to update the lattice.config.js file and set the hostname and port of your pilosa server, otherwise it will use the browser url. The default pilosa server is localhost:10101
If you will be consistently working in the repo, it may be useful to locally ignore changes to this file to prevent accidental commits by using:
git update-index --assume-unchanged src/lattice.config.js
yarn start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
Embedding Lattice within Pilosa
Lattice can be embedded within the Pilosa binary, so the UI is fully accessible directly from the server, reducing operational complexity.
If additional build dependencies yarn (brew install yarn and brew upgrade yarn perhaps) and statik (make install-statik) are available on your system, running make generate-statik before make install should produce a Pilosa binary with Lattice embedded. For up to date instructions, check the Pilosa README.