The Cat Breed API is live here: https://focused-elion-17290b.netlify.com/
It serves the backend for Client Cat https://github.com/rendall/client-cat
- GET /breed
- GET /breed/{id}
- GET /breed?search={term}
Source code is primarily in the ./ts
folder which is a mirror of the project folder. A developer would mostly only touch the files in there. The build step compiles and moves the generated .js
files to the project folder.
yarn run build
: compiles the source codeyarn run test
: tests the APIyarn run serve
: serves a local version at localhost
First check the assumptions, below, then:
-
git clone https://github.com/rendall/api-cat.git
Then in the
api-cat
directory, type these commands in order: -
yarn install
ornpm install
: installs all dependencies -
tsc
: compiles.ts
files into.js
-
yarn run insert
: seeds a mongo Atlas cluster -
yarn run build
If all went well, the API is ready for deployment.
-
git push . master:deploy
-
git push origin deploy:deploy
git
is installednode
is installed (version in./.nvmrc
file:v11.9.0
)yarn
is installed (optional), otherwisenpm
is fine- a
.env
file exists, following.env.example
- a MongoDB Atlas cluster is provisioned
- that has two users
- a reader which has read access to the 'breeds' collection of the 'cat' database
- and an admin which can create a database
- and their respective connection strings are in the
.env
file (see.env.example
)
- that has two users
- a Netlify account and site is set up
- that deploys the
deploy
branch - environment variables are in site settings
- that deploys the