Fix bug with no random + prevent user from starting game + ENV vars
This commit is contained in:
parent
f80ff9c60d
commit
1f3b6ec70a
6 changed files with 66 additions and 30 deletions
11
app/[id]/socket.ts
Normal file
11
app/[id]/socket.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
'use server'
|
||||
|
||||
export default async function getSocketUrl() {
|
||||
const ssl = process.env.USE_SSL == undefined ? false : process.env.USE_SSL
|
||||
const url = process.env.URL == undefined ? "localhost:3000" : process.env.URL
|
||||
|
||||
const protocol = ssl ? "wss://" : "ws://"
|
||||
|
||||
console.log(protocol + url)
|
||||
return protocol + url
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue