init db and socket changes for prod
This commit is contained in:
parent
f2c8213255
commit
a3eab9dc79
@ -3,6 +3,8 @@ const cbor = require('borc');
|
||||
|
||||
const actions = require('./actions');
|
||||
|
||||
const SOCKET_URL = process.env.NODE_ENV === 'production' ? 'ws://cryps.gg:40000' : 'ws://localhost:40000';
|
||||
|
||||
function errorToast(err) {
|
||||
console.error(err);
|
||||
return toast({
|
||||
@ -21,7 +23,7 @@ function createSocket(store) {
|
||||
let gameStateTimeout;
|
||||
|
||||
function connect() {
|
||||
ws = new WebSocket('ws://localhost:40000');
|
||||
ws = new WebSocket(SOCKET_URL);
|
||||
ws.binaryType = 'arraybuffer';
|
||||
|
||||
// Connection opened
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo apt-get install -y postgresql postgresql-contrib
|
||||
# sudo apt-get install -y postgresql postgresql-contrib
|
||||
sudo service postgresql start
|
||||
sudo -u postgres dropdb cryps
|
||||
sudo -u postgres createdb cryps
|
||||
sudo -u postgres echo "craftbeer" > /var/lib/postgres/.pgpass
|
||||
sudo -u postgres createuser --encrypted cryps
|
||||
sudo -u postgres psql -c "alter user cryps with encrypted password 'craftbeer';"
|
||||
|
||||
npm i
|
||||
npm run migrate
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user