remove env file, make ws secure in prod
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,5 +5,6 @@ _/build
|
||||
content
|
||||
db/*
|
||||
server/db/users.json
|
||||
server/.env
|
||||
abetaccredited.html
|
||||
qrCodes/qr_codes
|
||||
@@ -1,3 +0,0 @@
|
||||
BASE_URL=http://localhost:3003
|
||||
JWT_SECRET=950b15c8c1c8a27dd716bba3ab51d96ce49afa85cae72884cf22e936e1bc0cb9
|
||||
ENV=development
|
||||
@@ -35,7 +35,6 @@ func main() {
|
||||
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if(loggedIn(w, r)) {
|
||||
log.Info().Msg("logged")
|
||||
if isWebSocketRequest(r) {
|
||||
handleWebSocket(w, r)
|
||||
return
|
||||
@@ -97,7 +96,6 @@ func handleSite(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if strings.Contains(r.URL.Path, "/_") {
|
||||
log.Debug().Msg("this is what it is")
|
||||
handleAsset(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class Connection {
|
||||
if(window.location.hostname === "localhost") {
|
||||
this.ws = new WebSocket("ws://" + "localhost:3003")
|
||||
} else {
|
||||
this.ws = new WebSocket("ws://" + window.location.hostname + window.location.pathname)
|
||||
this.ws = new WebSocket("wss://" + window.location.hostname + window.location.pathname)
|
||||
}
|
||||
this.ws.addEventListener('open', () => {
|
||||
this.connectionTries = 0
|
||||
|
||||
Reference in New Issue
Block a user