Rename --host => --root-url

This commit is contained in:
Daan Sprenkels
2019-12-17 15:43:32 +05:30
parent 3d07acb222
commit ffeb9a3362
7 changed files with 53 additions and 36 deletions

View File

@@ -7,10 +7,10 @@ the command line.
## USAGE
# Upload a file
curl -F'file=@yourfile.png' {{.Host}}
curl -F'file=@yourfile.png' {{.RootURL}}
# Shorten a URL
curl -F'shorten=http://example.com/some/long/url' {{.Host}}
curl -F'shorten=http://example.com/some/long/url' {{.RootURL}}
# The first line of the result will contain the shortened URL.
#
@@ -18,4 +18,4 @@ the command line.
# information on how to delete the shortened object.
# To upload a file and only extract the shortened URL (i.e. throw away the rest)
curl -F'file=@yourfile.png' {{.Host}} | head -n 1
curl -F'file=@yourfile.png' {{.RootURL}} | head -n 1

View File

@@ -1,7 +1,7 @@
{{.Host}}/{{.Paste.Key}}{{.FileExt}}
{{.RootURL}}/{{.Paste.Key}}{{.FileExt}}
---
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
with delete token: {{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Request.URL.Query.Get "deleteToken"}}
with delete token: {{.RootURL}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}
{{else -}}
with delete token: <unknown>
{{end -}}type: {{.Paste.Type}}
@@ -16,6 +16,6 @@ delete token: {{.CanDelete}}
{{if and (ne .Paste.State.String "deleted") .CanDeleteBool}}
```
# To delete this {{.Paste.Type}}, execute:
curl --request "DELETE" "{{.Host}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}"
curl --request "DELETE" "{{.RootURL}}/{{.Paste.Key}}{{.FileExt}}?deleteToken={{.Paste.DeleteToken}}"
```
{{end}}