Add deploy script and move some vars to env file for prod and local

This commit is contained in:
Tim 2021-07-15 02:12:19 +02:00
parent 019f359854
commit 46ee666437
5 changed files with 9 additions and 2 deletions

2
.env.development Normal file
View File

@ -0,0 +1,2 @@
VUE_APP_BASE_URL=http://localhost:8000/
VUE_APP_NAME=Bobby

2
.env.production Normal file
View File

@ -0,0 +1,2 @@
VUE_APP_BASE_URL=https://perudo.loken.nl/
VUE_APP_NAME=

3
deploy.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/sh
npm run build
scp -r dist/* www-data@cemophora:/var/www/perudo-client.loken.nl/

View File

@ -2,7 +2,7 @@ import axios, {AxiosPromise, AxiosResponse} from 'axios'
import {JoinCreateGameObject, IsStartedObject, ApiObject, GameStateObject, MyTurnObject, GuessAction} from "@/objects/objects";
export default class PerudoApi {
private static baseUrl = 'http://localhost:8000/'
private static baseUrl = process.env.VUE_APP_BASE_URL;
private static objectInstance?: PerudoApi;

View File

@ -112,7 +112,7 @@ export default class Home extends Vue {
private gameStateObject: GameStateObject | null = null;
private error: string | null = null;
private name: string = 'Bobby';
private name: string = process.env.VUE_APP_NAME;
private code: string = '';
private owner: boolean = false;