This API provides endpoints to retrieve services and related data.
The cdk.json
file tells the CDK Toolkit how to execute your app.
- AWS account with necessary permissions to create and deploy AWS CloudFormation stacks
- Node.js v12 or later
- AWS CLI
- AWS CDK
git clone <repository-url>
npm install
npm run prepare
npm run test-coverage
npm run test-view
- Open the terminal and navigate to the project directory.
- Run the following command to bootstrap the AWS environment:
cdk bootstrap aws://<AWS-Region>/<AWS-Account-ID>
Need to only run this once for every new region to deploy to.
- Configure the AWS credentials in your environment using the AWS CLI:
aws configure
- Deploy the stack using the following command:
cdk deploy
Deployment to environment will depend on what branch you're in, if you run the command in staging branch then it will start deployment to the staging environment.
The API provides the following endpoints:
- GET /services: Retrieves a list of services.
- GET /services/:service_name/:service_type: Retrieves a list of services by name and type.
- GET /services/:service_name: Retrieves a list of services by name.
- POST /services: Retrieves a list of services by query parameters.
- GET /options/:question_name: Retrieves options for a particular question.
To start the API server, run the following command:
npm run start
The codebase uses TSLint for linting and Prettier for code formatting. To run the linter and fix formatting issues, use the following commands:
npm run lint
npm run lint:fix
To format the codebase using Prettier, use the following command:
npm run format
To run the tests, use the following command:
npm run test
The API is deployed automatically when you push changes to the dev, staging, or master branch using Bitbucket Pipelines.
To contribute to this project, follow these steps:
- Fork this repository.
- Create a new branch with your changes: git checkout -b my-feature-branch
- Commit your changes: git commit -am 'Add some feature'
- Push the changes to your branch: git push origin my-feature-branch
- Submit a pull request.