Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

Commit

Permalink
feature/deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
DainWs committed May 29, 2022
1 parent c1f5db3 commit c1eaebc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 26 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"private": true,
"scripts": {
"start": "cd void-eye-games-client && npm run start && cd ..",
"build": "cd void-eye-games-client && npm run build && cd ..",
"deploy": "npm run install",
"build": "npm run build-client",
"deploy": "npm install",
"install": "npm run install-api && npm run install-client",
"install-api": "cd void-eye-games-api && composer install && cd ..",
"install-client": "cd void-eye-games-client && npm install && cd .."
"install-client": "cd void-eye-games-client && npm install && cd .. && npm run build-client",
"build-client": "cd void-eye-games-client && npm run build && cd .."
},
"keywords": [],
"author": "Jose Antonio Duarte Perez",
Expand Down
16 changes: 0 additions & 16 deletions void-eye-games-api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,4 @@ vendor
cache/*
cache/credentials.json
composer.lock
!assets/images/not-found.png
!assets/images/games/game-1.png
!assets/images/games/game-2.png
!assets/images/games/game-3.png
!assets/images/games/medias/1-1.png
!assets/images/games/medias/1-2.mp4
!assets/images/games/medias/2-3.webm
!assets/images/games/medias/2-4.png
!assets/images/games/medias/2-6.png
!assets/images/games/medias/3-5.jpg
!assets/images/games/medias/3-10.png
!assets/images/plataforms/plataform-1.png
!assets/images/plataforms/plataform-2.png
!assets/images/plataforms/plataform-3.png
!assets/images/plataforms/plataform-4.png
!assets/images/plataforms/plataform-5.png
assets/images/*
3 changes: 1 addition & 2 deletions void-eye-games-client/.env.production
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
HTTPS=false
BUILD_PATH=../public
DOMAIN=http://voideyegame.com
DOMAIN=https://voideyegames.ddns.net
REACT_APP_BASEHOME=/VoidEyeGames/public/
REACT_APP_PUBLIC=$DOMAIN/VoidEyeGames
REACT_APP_PUBLIC_CLIENT=$REACT_APP_PUBLIC/public
Expand Down
7 changes: 4 additions & 3 deletions void-eye-games-client/src/services/socket/SocketController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ import axios from 'axios';
import { SocketDataProvideer } from './SocketDataProvider';
import SocketRequest from './SocketRequest';

export const API_URL = process.env.REACT_APP_PUBLIC_API;
let host = process.env.REACT_APP_PUBLIC_API;
export const API_URL = host.replace('{host}', window.location.host);

class SocketController {
send(destination, onError = onHandleError) {
this.sendCustom(new SocketRequest(), destination, onError);
}

sendCustom(request, destination, onError = onHandleError) {
axios.request(this.getUrlFor(destination), request)
axios.request(this.getUrlFor(destination), request, { rejectUnauthorized: false })
.then(response => {
SocketDataProvideer.supply(destination, response.data);
})
.catch(onError);
}

sendCustomWithCallback(request, destination, callback, onError = onHandleError) {
axios.request(this.getUrlFor(destination), request)
axios.request(this.getUrlFor(destination), request, { rejectUnauthorized: false })
.then(response => callback(response))
.catch(onError);
}
Expand Down
4 changes: 2 additions & 2 deletions void-eye-games-client/src/services/socket/SocketRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class SocketRequest {
this.url = API_URL;
this.method = 'GET';
this.params = {};
this.headers = {'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json'};
this.headers = {'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', 'Content-Type': 'application/json'};
}

paramsSerializer(params) {
Expand All @@ -19,7 +19,7 @@ class SocketRequest {
}

setContentType(contentType) {
this.headers = {'Access-Control-Allow-Origin': '*', 'Content-Type': contentType};
this.headers = {'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Headers': '*', 'Content-Type': contentType};
}

setParams(params) {
Expand Down

0 comments on commit c1eaebc

Please sign in to comment.