Compare commits

..

3 Commits

Author SHA1 Message Date
5be5ee5e40 added nginx config 2023-08-06 03:56:47 +03:00
878017ed8b fixed init variable bug 2023-08-06 03:56:12 +03:00
856c72ea57 updated api hosts 2023-08-06 03:55:37 +03:00
3 changed files with 19 additions and 4 deletions

View File

@ -4,8 +4,8 @@ let DEBUG = false;
window.DEBUG = DEBUG;
let SERVER_HOST;
if (DEBUG) SERVER_HOST = 'localhost';
else SERVER_HOST = 'a2s.su';
if (DEBUG) SERVER_HOST = 'http://localhost:50009';
else SERVER_HOST = 'https://a2s.su';
window.SERVER_HOST = SERVER_HOST;
/* main */
@ -72,7 +72,7 @@ function get_from_api(callback, api_method = '', params = {}) {
if (api_method == '') {
console.log('wrong method');
} else {
let url = `http://${SERVER_HOST}:50009/api/v1.0/${api_method}`;
let url = `${SERVER_HOST}/api/v1.0/${api_method}`;
let opts = {
method: 'get',
headers: {

View File

@ -16,7 +16,7 @@ export function update_rev2(data) {
// Обновление HP
const content_element = document.getElementById('rev2_emenies');
data.enemies.forEach((emeny) => {
enemy_data = emeny.split(' ');
let enemy_data = emeny.split(' ');
// Элемент с именем монстра
const enemy_name = document.createElement('p');

15
server/nginx.conf Normal file
View File

@ -0,0 +1,15 @@
server {
listen 80;
listen 443 ssl;
server_name a2s.su;
ssl_certificate fullchain.pem;
ssl_certificate_key privkey.pem;
root /home/alex/Sites/a2s.su/www;
location /api/ {
proxy_pass http://127.0.0.1:50009;
}
}