Browse Source

0.0.2

master 0.0.2
Atridad Lahiji 4 weeks ago
parent
commit
151692c3ba
  1. 2
      build.sh
  2. 12
      frontend/index.html
  3. 7
      go.mod
  4. 9
      main.go

2
build.sh

@ -1,6 +1,6 @@
#!/bin/bash
VERSION="0.0.1"
VERSION="0.0.2"
export OLD_GOOS=$(go env GOOS)

12
frontend/index.html

@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MiddleWhere</title>
</head>
<body>
MiddleWhere
</body>
</html>

7
go.mod

@ -1,13 +1,8 @@
module git.atrilahiji.dev/atrilahiji/eleutheriapay
module git.atrilahiji.dev/atrilahiji/middlewhere
go 1.16
require (
github.com/GeertJohan/go.rice v1.0.2 // indirect
github.com/ajstarks/svgo v0.0.0-20200725142600-7a3c8b57fecb // indirect
github.com/campoy/svg-badge v0.0.0-20180116034456-40c38fcad9f6 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/joho/godotenv v1.3.0 // indirect
github.com/stripe/stripe-go/v72 v72.37.0 // indirect
golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect
)

9
main.go

@ -1,12 +1,12 @@
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
rice "github.com/GeertJohan/go.rice"
"github.com/joho/godotenv"
)
@ -17,6 +17,11 @@ func loadEnv() {
}
}
func frontEndHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
fmt.Fprint(w, "<h1>MiddleWhere?!?!?!?!?!</h1>")
}
func healthCheckHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("Health Check"))
@ -52,7 +57,7 @@ func webHookHandler(w http.ResponseWriter, r *http.Request) {
func main() {
loadEnv()
http.Handle("/", http.FileServer(rice.MustFindBox("frontend").HTTPBox()))
http.HandleFunc("/", frontEndHandler)
http.HandleFunc("/api/healthcheck", healthCheckHandler)

Loading…
Cancel
Save