Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Latest commit

 

History

History
58 lines (55 loc) · 3.1 KB

File metadata and controls

58 lines (55 loc) · 3.1 KB

Fastify for Meadowlark

Fastify is fast, low-overhead web framework for node-js. Fastify provides a local API layer for project Meadowlark.

Instructions for running a local "developer" environment:

  1. Make a copy of .env.example found in /meadowlark-fastify folder and rename the new file to .env, this will provide the environment variables that Meadowlark requires to run
  2. Review the .env file and update any important settings. Pay attention, in particular to:
    • DOCUMENT_STORE_PLUGIN - The backend document store that Meadowlark will use
      • If using MongoDB set the value to @edfi/meadowlark-mongodb-backend
        • Update MONGO_URI to the location of your Mongo Instance
          • If running MongoDB via the local docker compose configuration, the default value for MONGO_URI is mongodb://mongo:abcdefgh1!@mongo1:27017,mongo2:27018,mongo3:27019/?replicaSet=rs0
      • If using PostgreSQL set the value to @edfi/meadowlark-postgresql-backend
        • Update POSTGRES_USERNAME and POSTGRES_PASSWORD
        • If your PostgreSQL instance is not running on the default port (5432), you can set POSTGRES_PORT to the port PostgreSQL is using
      • QUERY_HANDLER_PLUGIN and LISTENER1_PLUGIN - The query handler and listener that Meadowlark will use.
        • If using OpenSearch set the value to @edfi/meadowlark-opensearch-backend
          • Set the OPENSEARCH_ENDPOINT, OPENSEARCH_USERNAME and OPENSEARCH_PASSWORD
        • If using ElasticSearch set the value to @edfi/meadowlark-elasticsearch-backend
          • Set the ELASTICSEARCH_ENDPOINT
    • AUTHORIZATION_STORE_PLUGIN This is the plugin for the authorization store
      • If using MongoDB set the value to @edfi/meadowlark-mongodb-backend
      • If using PostgreSQL set the value to @edfi/meadowlark-postgresql-backend
    • OAUTH_SIGNING_KEY - The OAUTH_SIGNING_KEY may need quotation marks around the value, unlike other keys.
    • Logging configuration, as this can affect performance. For better performance, avoid debug and info levels for LOG_LEVEL, and set LOG_PRETTY_PRINT to false. Rather than log to console, use LOG_TO_FILE set to true and set the log file directory with LOG_FILE_LOCATION.
  3. If you have already built the Meadowlark-js project, you can skip to step 4, otherwise:
    • Open a command prompt and navigate to the /Meadowlark-js folder
    • Run npm install
    • Run npm run build
  4. Open a command prompt and navigate to the /Meadowlark-js/services/meadowlark-fastify folder
  5. Run npm run start:local to start the Fastify service
    • In another terminal, you can test connectivity with curl http://localhost:3000/local/
    • Also you can use the .http files that use the Visual Studio Code REST Client extension, from the test directory. You can try with the 33b test