mirror of
https://github.com/cjdenio/jia.git
synced 2024-11-29 02:33:40 +00:00
CORS stuff
This commit is contained in:
parent
a4ecc652e3
commit
3342f3ed4a
1 changed files with 2 additions and 0 deletions
|
@ -38,6 +38,8 @@ func StartServer(config *Config) {
|
||||||
http.HandleFunc("/slack/leaderboard", HandleLeaderboardSlashCommand)
|
http.HandleFunc("/slack/leaderboard", HandleLeaderboardSlashCommand)
|
||||||
http.HandleFunc("/slack/eventsCommand", HandleEventsSlashCommand)
|
http.HandleFunc("/slack/eventsCommand", HandleEventsSlashCommand)
|
||||||
http.HandleFunc("/api/currentNumber", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/api/currentNumber", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Add("Access-Control-Allow-Origin", "*")
|
||||||
|
|
||||||
number, err := redisClient.Get("last_valid_number").Int()
|
number, err := redisClient.Get("last_valid_number").Int()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(500)
|
w.WriteHeader(500)
|
||||||
|
|
Loading…
Reference in a new issue