Skip to content

Commit

Permalink
Working on a frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
p5764 committed Jul 25, 2015
1 parent 2a1665d commit 70c40f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package main

import (
"github.com/gorilla/mux"
"log"
"net/http"
"os"

"github.com/gorilla/mux"
)

func Log(handler http.Handler) http.Handler {
Expand All @@ -22,13 +23,12 @@ var db SparkleDatabase

func main() {
r := mux.NewRouter()
r.HandleFunc("/", defaultHandler).Methods("GET")
r.HandleFunc("/sparkles", addSparkle).Methods("POST")
r.HandleFunc("/sparkles", getSparkles).Methods("GET")
r.HandleFunc("/top/giver", topGiven).Methods("GET")
r.HandleFunc("/top/receiver", topReceived).Methods("GET")
r.HandleFunc("/sparkles/{recipient}", getSparklesForRecipient).Methods("GET")

r.PathPrefix("/").Handler(http.FileServer(http.Dir("./public/")))
// Load the database from file
db = LoadDB()

Expand Down
9 changes: 9 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<title>Sparkles!</title>
</head>
<body>
<h1>Sparkles</h1>

</body>
</html>
Empty file added public/js/app.js
Empty file.

0 comments on commit 70c40f2

Please sign in to comment.