From e7d9d07abf3dcd6cd22bda787b5767497d52f292 Mon Sep 17 00:00:00 2001 From: Timm Heuss Date: Fri, 21 Jun 2024 22:23:51 +0200 Subject: [PATCH] Externalise HTTP calls --- .github/workflows/build-and-push.yml | 6 ++++-- Readme.md | 1 + calls.http | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 calls.http diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 722ace1..24bb195 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -31,12 +31,14 @@ jobs: - name: Build amd64 image run: | docker buildx bake amd64 --load + - uses: actions/setup-node@v4 + with: + node-version: 'latest' - name: Test amd64 image run: | docker compose up --no-build --pull never -d sleep 5s - curl --fail 'http://localhost:80' - curl --fail 'http://localhost:80/makefulltextfeed.php?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml&max=1&links=preserve' + npx rest-cli calls.http --show headers docker compose down - name: Build all images run: | diff --git a/Readme.md b/Readme.md index 4b291fb..39b4216 100644 --- a/Readme.md +++ b/Readme.md @@ -35,3 +35,4 @@ volumes: - Interesting endpoints (see tab [Request & Response](http://localhost/#request)): - Article extraction: `http://localhost/extract.php?url=[url]` - Feed conversion: `http://localhost/makefulltextfeed.php?url=[url]` +- See [calls.http](calls.http) for example calls diff --git a/calls.http b/calls.http new file mode 100644 index 0000000..67acfa8 --- /dev/null +++ b/calls.http @@ -0,0 +1,16 @@ +@baseUrl=http://localhost:80 + +### Index page +GET {{baseUrl}}/index.php + + +### Extract feed with max 1 article +GET {{baseUrl}}/makefulltextfeed.php + ?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml + &max=1 + &links=preserve + +### Extract article without images +GET {{baseUrl}}/extract.php + ?url=https://en.wikipedia.org/wiki/Vincent_van_Gogh + &images=0