summaryrefslogtreecommitdiff
path: root/api/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/main.go')
-rw-r--r--api/main.go44
1 files changed, 0 insertions, 44 deletions
diff --git a/api/main.go b/api/main.go
deleted file mode 100644
index c4645b8..0000000
--- a/api/main.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package api
-
-import (
- "fmt"
- "net/http"
-
- redqdb "sinanmohd.com/redq/db"
-)
-
-func Run(db *redqdb.SafeDB) {
- const prefix string = "POST /_redq/api"
-
- login := newLogin(db)
- http.Handle(prefix+"/ac/login", login)
- exampleApi := newExamplApiName(db)
- http.Handle(prefix+"/example", exampleApi)
-
- http.HandleFunc("GET /{$}", home)
- http.ListenAndServe(":8008", nil)
-}
-
-func home(rw http.ResponseWriter, r *http.Request) {
- const index string = `
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>🚨 redq</title>
- </head>
- <body>
- <center>
- <h1 style="font-size: 10em">
- redq is active
- </h1>
- <p style="font-weight: bold">
- we're soo back 🥳
- </p>
- </center>
- </body>
- </html>
- `
-
- fmt.Fprint(rw, index)
-}