A web server that provides a HTTP API to query the dependency list for an npm package with a given version.
To install dependencies and start the server in development mode:
npm install
npm startThe server will by default start on port 3000 and will restart on changes to the files in ./src/.
The server can be started on a custom port
npm start -- --port 3001The server contains two endpoints - /healthcheck and /package/:packageName/:packageVersion.
You can fetch the dependencies for [email protected] via:
curl http://localhost:3000/package/react/16.13.0 | jq .You can run the test suite with this command:
npm run testBy default this only runs unit and integration tests, but does not run the end-to-end tests.
The project contains unit, integration and end-to-end tests, located in /tests. You can execute them separately:
npm run test:unit
npm run test:integration
npm run test:e2eThe project uses typescript for type checking. You can run typescript via:
npm run buildTypescript will also transpile the code to javascript. You can find the transpiled code in ./dist/.
The code is linted using eslint. You can run the linter via:
npm run lintThe code is formatted using prettier. You can format the code via:
npm run formatYou can build a docker image and run a containerized version of the application:
docker build -t dependency_server . && docker run -p 3000:3000 dependency_server