Skip to content

Commit

Permalink
move api to ./api
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Sep 15, 2017
1 parent 1bbc605 commit 616f79c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
18 changes: 9 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

User polls for GitHub powered by [Up](https://github.com/apex/up).

[![](https://gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20A)](https://gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20A/vote)
[![](https://gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20B)](https://gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20B/vote)
[![](https://gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20C)](https://gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20C/vote)
[![](https://api.gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20A)](https://api.gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20A/vote)
[![](https://api.gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20B)](https://api.gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20B/vote)
[![](https://api.gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20C)](https://api.gh-polls.com/poll/01BM2T00TMSDTZWJ1RP6TQF200/Option%20C/vote)

## About

Expand All @@ -30,19 +30,19 @@ Create a new poll for who is the best ferret.
$ polls new Tobi Loki Jane
```

[![](https://gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Tobi)](https://gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Tobi/vote)
[![](https://gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Loki)](https://gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Loki/vote)
[![](https://gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Jane)](https://gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Jane/vote)
[![](https://api.gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Tobi)](https://api.gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Tobi/vote)
[![](https://api.gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Loki)](https://api.gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Loki/vote)
[![](https://api.gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Jane)](https://api.gh-polls.com/poll/01BM2ZHFZXYKQV9N3HNFXCBH3N/Jane/vote)

Create a new poll for the best species:

```
$ polls new "Cats are cool" "Dogs are better" "Ferrets for the win"
```

[![](https://gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Cats%20are%20cool)](https://gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Cats%20are%20cool/vote)
[![](https://gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Dogs%20are%20better)](https://gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Dogs%20are%20better/vote)
[![](https://gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Ferrets%20for%20the%20win)](https://gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Ferrets%20for%20the%20win/vote)
[![](https://api.gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Cats%20are%20cool)](https://api.gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Cats%20are%20cool/vote)
[![](https://api.gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Dogs%20are%20better)](https://api.gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Dogs%20are%20better/vote)
[![](https://api.gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Ferrets%20for%20the%20win)](https://api.gh-polls.com/poll/01BM2ZHPN7BA19X15SQDGX4D88/Ferrets%20for%20the%20win/vote)

## Statistics

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions up.json → api/up.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"stages": {
"production": {
"domain": "api.gh-polls.com"
},
"development": {
"domain": "dev.gh-polls.com"
}
}
}
2 changes: 1 addition & 1 deletion cmd/polls/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// Config.
var (
version = "master"
endpoint = "https://gh-polls.com"
endpoint = "https://api.gh-polls.com"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ func CopyToClipboard(id string, options []string) error {

// Link returns a poll option link with image.
func Link(id, option string) string {
return fmt.Sprintf(`[%s](https://gh-polls.com/poll/%s/%s/vote)`, Image(id, option), id, url.PathEscape(option))
return fmt.Sprintf(`[%s](https://api.gh-polls.com/poll/%s/%s/vote)`, Image(id, option), id, url.PathEscape(option))
}

// Image returns a poll option image.
func Image(id, option string) string {
return fmt.Sprintf(`![](https://gh-polls.com/poll/%s/%s)`, id, url.PathEscape(option))
return fmt.Sprintf(`![](https://api.gh-polls.com/poll/%s/%s)`, id, url.PathEscape(option))
}

0 comments on commit 616f79c

Please sign in to comment.