cendenta / organization-tree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

This solution uses SST, a framework built on top of the AWS CDK.

Prerequisites

Run Solution

  • Clone this repository using the Code link at the top of the page.
  • Open the cloned repository folder in Visual Studio Code.
  • Open a terminal to the root folder of the repository, and execute the following:
# Install dependencies
npm install

# Start SST
npm start
  • Follow prompts to configure a stage name (dev is used below) or accept the default.
  • After deployment, the terminal will show something similar to the following:

Listening for requests

  • Open console.sst.dev.
  • Navigate to the API tab to observe the defined REST endpoints.
  • Confirm that the GET endpoints function as expected

Warning DELETE, POST, and PUT endpoints are not implemented, so only the organization data provided is currently used.

GET /employees

Returns all employees (including manager).

GET /employees

GET /employees/{employeeId}

Returns a single employee for a valid employeeId parameter.

GET /employees/{employeeId}

GET /employees/{employeeId}?includingReportingTree=true

Returns a tree of directReports for the employee when the includeReportingTree=true query parameter is included.

GET /employees/{employeeId}?includingReportingTree=true

Run Unit Tests

  • Navigate to the Testing tab in Visual Studio Code.
  • Click Run Tests.

Warning Test failures shown here indicate unimplemented methods.

Test execution

Remove Artifacts

# Delete all deployed artifacts from AWS
npx sst remove

About


Languages

Language:TypeScript 100.0%