Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the run argument to the docker command. #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ WORKDIR /app

VOLUME /app/templates

CMD ["./go-wkhtmltox"]
CMD ["./go-wkhtmltox", "run"]
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ go-wkhtmltox

```bash
docker pull idocking/go-wkhtmltox:latest
docker run -it -d -p 8080:8080 idocking/go-wkhtmltox:latest ./go-wkhtmltox run
docker run -it -d -p 8080:8080 idocking/go-wkhtmltox:latest
```

or
Expand All @@ -26,7 +26,7 @@ or
```

> then you could access the 8080 port
> in osx, you could get the docker ip by command `docker-machine ip`,
> in osx, you could get the docker ip by command `docker-machine ip`,
> and the access service by IP:8080

## Config
Expand All @@ -38,7 +38,7 @@ or

service {
path = "/v1"

cors {
allowed-origins = ["*"]
}
Expand Down Expand Up @@ -213,7 +213,7 @@ curl -X POST \

### Template

The defualt template is
The default template is

```
{"code":{{.Code}},"message":"{{.Message}}"{{if .Result}},"result":{{.Result|Jsonify}}{{end}}}
Expand All @@ -240,17 +240,17 @@ we could add `template` to render as different response, we have another example
}
```

the response is
the response is

```html
<html>
<body>
<img src="data:image/jpeg;base64,bGl............"/>
<img src="data:image/jpeg;base64,bGl............"/>
</body>
</html>
```

So, the template will render at brower directly. you could add more your templates
So, the template will render at browser directly. you could add more your templates

#### Template funcs

Expand Down Expand Up @@ -287,7 +287,7 @@ type ConvertResponse struct {

Name|Usage
:--|:--
|default template, retrun `code`,`message`, `result`
|default template, return `code`,`message`, `result`
render-html|render data to html
binary|you cloud use curl to download directly

Expand Down Expand Up @@ -328,7 +328,7 @@ curl -X POST \

### Fetcher

fetcher is an external source input, sometimes we could not fetch data by url, or the wkthmltox could not access the url because of some auth options
fetcher is an external source input, sometimes we could not fetch data by url, or the wkhtmltox could not access the url because of some auth options

##### Data fetcher

Expand Down Expand Up @@ -430,7 +430,7 @@ func NewDataFetcher(conf config.Configuration) (dataFetcher fetcher.Fetcher, err

```

step 2: Reigister your driver
step 2: Register your driver

```go
func init() {
Expand All @@ -455,7 +455,7 @@ import (



# Use this package as libary
# Use this package as library

Just import `github.com/gogap/go-wkhtmltox/wkhtmltox`

Expand All @@ -464,4 +464,4 @@ htmlToX, err := wkhtmltox.New(wkHtmlToXConf)
//...
//...
convData, err := htmlToX.Convert(fetcherOpts, convertOpts)
```
```