An api server to store recipes and ingredients.
Create a new configuration file off of the sample one:
cp env-sample .env
(make optional edits)
docker-compose up
Once the server is running, the API is available at http://localhost:8080 (by default, can be changed by editing .env
)
GET /recipes
: Get all recipes
POST /recipes
: Create a recipe
GET /recipes/:id
: Get a recipe
PUT /recipes/:id
: Update a recipe entirely
PATCH /recipes/:id
: Update a recipe partially
DELETE /recipes/:id
: Delete a recipe
Request payloads must be of type JSON.
See ./tests/integration/recipe.test.js
for examples.
Use any editor compatible with devcontainers. Ideally Microsoft Visual Studio Code or Github Code Spaces.
Github's Code Spaces are also a great way to test out and contribute to this project!
If you don't want to use neither, you should be able to start docker-compose
with ./devcontainer/docker-compose.yml
as configuration file, like so: docker-compose --project-name server -f docker-compose.yml -f .devcontainer/docker-compose.yml up --build
.
You'll be missing yarn
which is used for managing packages which can be added by running apk add --no-cache yarn; yarn
in a terminal in the server container.
yarn test
for one time tests run, yarn test:watch
for continuous tests running (watches file changes).