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:
- 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 - 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
ismongodb://mongo:abcdefgh1!@mongo1:27017,mongo2:27018,mongo3:27019/?replicaSet=rs0
- If running MongoDB via the local docker compose
configuration, the default value for
- Update
- If using PostgreSQL set the value to
@edfi/meadowlark-postgresql-backend
- Update
POSTGRES_USERNAME
andPOSTGRES_PASSWORD
- If your PostgreSQL instance is not running on the default port (5432),
you can set
POSTGRES_PORT
to the port PostgreSQL is using
- Update
QUERY_HANDLER_PLUGIN
andLISTENER1_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
andOPENSEARCH_PASSWORD
- Set the
- If using ElasticSearch set the value to
@edfi/meadowlark-elasticsearch-backend
- Set the
ELASTICSEARCH_ENDPOINT
- Set the
- If using OpenSearch set the value to
- If using MongoDB set the value to
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
- If using MongoDB set the value to
OAUTH_SIGNING_KEY
- TheOAUTH_SIGNING_KEY
may need quotation marks around the value, unlike other keys.- Logging configuration, as this can affect performance. For better
performance, avoid
debug
andinfo
levels forLOG_LEVEL
, and setLOG_PRETTY_PRINT
to false. Rather than log to console, useLOG_TO_FILE
set to true and set the log file directory withLOG_FILE_LOCATION
.
- 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
- Open a command prompt and navigate to the
- Open a command prompt and navigate to the
/Meadowlark-js/services/meadowlark-fastify
folder - 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
- In another terminal, you can test connectivity with