Snooty Data API is a REST API that returns build artifacts for docs builds.
Node 18 was used to start this project. Please make sure you have Node 18 installed locally. If you have nvm, you can run nvm use
to switch to the expected version of Node.
Use npm
v8 to install dependencies:
npm ci
Use the sample.env
file to help configure a local .env
file.
If a local database is desired for development, make sure to install MongoDB Community Edition via Homebrew. Otherwise, an Atlas connection string should be used in your .env
file with snooty_dev
as the database.
The build data to be used by this API server is saved by the Autobuilder's Persistence Module. If using a local database, feel free to use the Persistence Module to help save bundled artifacts generated by the Snooty Parser.
To start the server, run:
npm run dev
By default, the server should be accessible through http://localhost:3000/.
Tests are ran by Jest and rely on Supertest for testing Express route logic. MongoDB Memory Server is used to help perform MongoDB queries in tests without having to worry about running a local MongoDB instance.
To run tests, use:
npm run test
We use eslint
for linting and prettier
for formatting. prettier
is configured to run on lint, so feel free to just use:
npm run lint
If there are errors flagged through prettier
, use:
npm run format:fix
To release a new version of the data API to production, tag a new version from the Releases page. That tag will then be promoted to prod.
The following are the base URLs for the Snooty Data API:
https://snooty-data-api.mongodb.com/
https://snooty-data-api.docs.staging.corp.mongodb.com/