mirror of
https://github.com/derfenix/webarchive.git
synced 2026-03-11 22:40:58 +03:00
Update README.md
This commit is contained in:
16
README.md
16
README.md
@@ -39,14 +39,14 @@ in case of any conflicts.
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
#### 1. Start the server
|
### 1. Start the server
|
||||||
|
|
||||||
##### Start without docker
|
#### Start without docker
|
||||||
```shell
|
```shell
|
||||||
go run ./cmd/server/main.go
|
go run ./cmd/server/main.go
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Change API address
|
#### Change API address
|
||||||
```shell
|
```shell
|
||||||
API_ADDRESS=127.0.0.1:3001 go run ./cmd/server/main.go
|
API_ADDRESS=127.0.0.1:3001 go run ./cmd/server/main.go
|
||||||
```
|
```
|
||||||
@@ -57,7 +57,7 @@ API_ADDRESS=127.0.0.1:3001 go run ./cmd/server/main.go
|
|||||||
docker compose up -d webarchive
|
docker compose up -d webarchive
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2. Add a page
|
### 2. Add a page
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -X POST --location "http://localhost:5001/pages" \
|
curl -X POST --location "http://localhost:5001/pages" \
|
||||||
@@ -78,7 +78,7 @@ curl -X POST --location \
|
|||||||
"http://localhost:5001/pages?url=https%3A%2F%2Fgithub.com%2Fwkhtmltopdf%2Fwkhtmltopdf%2Fissues%2F1937&formats=pdf%2Cheaders&description=Foo+Bar"
|
"http://localhost:5001/pages?url=https%3A%2F%2Fgithub.com%2Fwkhtmltopdf%2Fwkhtmltopdf%2Fissues%2F1937&formats=pdf%2Cheaders&description=Foo+Bar"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. Get the page's info
|
### 3. Get the page's info
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -X GET --location "http://localhost:5001/pages/$page_id" | jq .
|
curl -X GET --location "http://localhost:5001/pages/$page_id" | jq .
|
||||||
@@ -87,7 +87,7 @@ where `$page_id` — value of the `id` field from previous command response.
|
|||||||
If `status` field in response is `success` (or `with_errors`) - the `results` field
|
If `status` field in response is `success` (or `with_errors`) - the `results` field
|
||||||
will contain all processed formats with ids of the stored files.
|
will contain all processed formats with ids of the stored files.
|
||||||
|
|
||||||
#### 4. Open file in browser
|
### 4. Open file in browser
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
xdg-open "http://localhost:5001/pages/$page_id/file/$file_id"
|
xdg-open "http://localhost:5001/pages/$page_id/file/$file_id"
|
||||||
@@ -95,13 +95,13 @@ xdg-open "http://localhost:5001/pages/$page_id/file/$file_id"
|
|||||||
Where `$page_id` — value of the `id` field from previous command response, and
|
Where `$page_id` — value of the `id` field from previous command response, and
|
||||||
`$file_id` — the id of interesting file.
|
`$file_id` — the id of interesting file.
|
||||||
|
|
||||||
#### 5. List all stored pages
|
### 5. List all stored pages
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -X GET --location "http://localhost:5001/pages" | jq .
|
curl -X GET --location "http://localhost:5001/pages" | jq .
|
||||||
```
|
```
|
||||||
|
|
||||||
### Roadmap
|
## Roadmap
|
||||||
|
|
||||||
- [x] Save page to pdf
|
- [x] Save page to pdf
|
||||||
- [x] Save URL headers
|
- [x] Save URL headers
|
||||||
|
|||||||
Reference in New Issue
Block a user