- Create a new private repo in your personal github account titled
bw-recruiting
- Run the following commands to clone and push this project to your newly created repo:
git clone git@github.com:beezwax/recruiting-widget-creator.git
cd recruiting-widget-creator
rm -rf .git
git init
git add .
git commit -m 'First commit'
git remote add origin https://github.com/YOUR_USERNAME/bw-recruiting.git
git push origin -u main
- Create a new branch which implements the feature request below.
- Create a pull request in your repo showing your changes.
- Assign the PR to the account listed in the email from us. You'll need to invite that account to collaborate in the repo.
You are tasked with creating an API to access information about a global satellite transponder network. The network is constructed such that local satellites only communicate to a single parent satellite. Those parent satellites then communicate to their parents, and so on. There can be any number of levels of nesting and there may be multiple root top level satellites.
The transponder data is stored in a sqlite database available at db/transponders.db
.
Your tasks:
- Create a
/transponders
endpoint which returns a JSON array of all top level transponders. Each transponder should contain the following information:id
,name
,children
. An example:
{
"transponders": [
{
"id": 1,
"name": "a",
"children": [{ "id": 2, "name": "b", "children": [] }]
}
]
}
- Add a
/count
endpoint that takes an optionalid
parameter. Ifid
is not specified the endpoint should return the total number of nodes present in the system. Ifid
is specified it should return the number of immediate children for the given transponder.
npm install
npm start