Skip to content
Permalink
Browse files

Add badgedata support

  • Loading branch information
davidnewhall committed Jul 17, 2019
1 parent 7412d34 commit 89451a0a783b9c1991313c0a5cc6e70e9c023e14
Showing with 29 additions and 18 deletions.
  1. +14 −0 .gcloudignore
  2. +5 −15 README.md
  3. +3 −0 appengine.go
  4. +3 −3 config.yaml
  5. +4 −0 main.go
@@ -0,0 +1,14 @@
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore
@@ -19,19 +19,9 @@ This is the source that runs [https://code.golift.io](https://code.golift.io).
- Path redirects. Issue 302s for specific paths.
- Useful for redirecting to download links on GitHub.

#### TODO
Incorporate a badge package for data collection and return.
In other words, I want to make this app collect data from "things"
#### Other
Incorporated a badge package for data collection and return.
In other words this app can collect data from "things"
(like the public grafana api) and store that data for later requests.
I will use this to populate badge/shield data for things like "grafana
dashboard download counter"
```json
{
"subject": "leftSide",
"status": "rightSide",
"color": "blue"
}
```
```
/https/code.golift.io/badge/grafana/dashboard/downloads/id+id+id+id
```
I use this to populate badge/shield data for things like "grafana
dashboard download counter" - [https://github.com/golift/badgedata](https://github.com/golift/badgedata)
@@ -21,6 +21,8 @@ import (
"log"
"net/http"

"code.golift.io/badgedata"
_ "code.golift.io/badgedata/grafana"
"google.golang.org/appengine"
)

@@ -34,6 +36,7 @@ func main() {
log.Fatal(err)
}
http.Handle("/", h)
http.Handle("/bd/", badgedata.Handler())
appengine.Main()
}

@@ -30,9 +30,9 @@ redir_paths: ["tar.gz", "wiki", "releases"]

# Paths that get handled by this app.
paths:
/badge:
repo: https://github.com/golift/badge
redir: https://github.com/golift/badge
/badgedata:
repo: https://github.com/golift/badgedata
redir: https://github.com/golift/badgedata
/unifi:
repo: https://github.com/golift/unifi
redir: https://github.com/golift/unifi
@@ -21,6 +21,9 @@ import (
"log"
"net/http"
"os"

"code.golift.io/badgedata"
_ "code.golift.io/badgedata/grafana"
)

func main() {
@@ -41,6 +44,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
http.Handle("/bd/", badgedata.Handler())
http.Handle("/", h)
log.Println("Listening at http://127.0.0.1:8080")
if err := http.ListenAndServe(":8080", nil); err != nil {

0 comments on commit 89451a0

Please sign in to comment.
You can’t perform that action at this time.