Skip to content

Commit

Permalink
Merge pull request #4 from heussd/httpcli
Browse files Browse the repository at this point in the history
Externalise HTTP calls
  • Loading branch information
heussd authored Jun 21, 2024
2 parents c82bb5b + e7d9d07 commit dfebcf4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions calls.http
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dfebcf4

Please sign in to comment.