The Output Gateway is an integral part of the Golemio data platform system, serving as a unified REST API for accessing data stored within the Golemio data platform.
This implementation utilizes the Express server and incorporates caching mechanisms powered by Redis.
For comprehensive documentation, please visit: Golemio Output Gateway Documentation
Refer to the API documentation at:
Developed by http://operatorict.cz
docker build -t output-gateway .
.env
file or add -e VAR=VALUE
to docker run. Env variables are described in .env.template
.docker run --rm \
-p 3004:3004 \ # expose port 3004
-e PORT=3004 \
-e POSTGRES_CONN: postgres://user:pass@postgres.dp_database/dataplatform \
output-gateway # docker image label (defined by step 1)
Install all prerequisites
Install all dependencies using command:
npm install
from the application's root directory.
To compile typescript code into js one-time (production build):
npm run build
To run the app:
npm run start
Run via TypeScript (in this case it is not needed to build separately, application will watch for changes and restart on save):
npm run dev-start
or run with a debugger:
npm run dev-start-debug
Runing the application in any way will load all config variables from environment variables or the .env file. To run, set all environment variables from the .env.template
file, or copy the .env.template
file into new .env
file in root directory and set variables there.
Project uses dotenv
package: https://www.npmjs.com/package/dotenv
Application is now running locally on port 3004 or on port specified in the environment variable.
Example data are stored in db/example/
.
For importing example data run psql -h $POSTGRES_HOST -U $POSTGRES_USER -d $POSTGRES_DB -f db/example/sql_dump.sql
.
To run all test defined in /test directory simply run this command:
npm run test
from the application's root directory. All tests should pass with the correct data. Test data are in the db/example
directory.
Logging uses pino
for standard logging with levels, pino-http
for http access logs and debug
(https://www.npmjs.com/package/debug) for debugging.
All logs with silly
and debug
level are printed as standard log (if appropriate log level is set) using pino
as well as using debug
module with "data-platform:output-gateway"
settings.
You can set both LOG_LEVEL
and DEBUG
settings in ENV variables.
For generating documentation run npm run generate-docs
. Typedoc source code documentation is located in docs/typedoc
.
More documentation in docs/
. If you want to add a new dataset or create new API routes, check out our existing modules.
The REST API specifications are located within each module's openapi.yaml
or openapi-output.yaml
file. You can find an illustrative example in the Parkings module.
To generate the API documentation, execute the command npm run build-apidocs
for all modules or npm run build-apidocs-public
for modules with endpoints containing Open Data, intended for public use. The documentation will be generated in the docs/generated
directory.
Please read CONTRIBUTING.md
.
Contact benak@operatorict.cz or vycpalek@operatorict.cz
Generated using TypeDoc