Fixing admin token for requests
This commit is contained in:
parent
f6803b6d5d
commit
331daca854
@ -10,6 +10,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
BROWSER: "chromium --use-fake-device-for-media-stream"
|
BROWSER: "chromium --use-fake-device-for-media-stream"
|
||||||
PROJECT_DIR: ${PROJECT_DIR}
|
PROJECT_DIR: ${PROJECT_DIR}
|
||||||
|
ADMIN_API_TOKEN: ${ADMIN_API_TOKEN}
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/project
|
- ./:/project
|
||||||
- ./maps:/maps
|
- ./maps:/maps
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const ADMIN_API_TOKEN = process.env.ADMIN_API_TOKEN;
|
||||||
|
|
||||||
export async function getPusherDump(): Promise<any> {
|
export async function getPusherDump(): Promise<any> {
|
||||||
let url = 'http://pusher.workadventure.localhost/dump?token=123';
|
let url = 'http://pusher.workadventure.localhost/dump?token='+ADMIN_API_TOKEN;
|
||||||
if (fs.existsSync('/project')) {
|
if (fs.existsSync('/project')) {
|
||||||
// We are inside a container. Let's use a direct route
|
// We are inside a container. Let's use a direct route
|
||||||
url = 'http://pusher:8080/dump?token=123';
|
url = 'http://pusher:8080/dump?token='+ADMIN_API_TOKEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (await axios({
|
return (await axios({
|
||||||
@ -14,12 +16,11 @@ export async function getPusherDump(): Promise<any> {
|
|||||||
})).data;
|
})).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function getBackDump(): Promise<any> {
|
export async function getBackDump(): Promise<any> {
|
||||||
let url = 'http://api.workadventure.localhost/dump?token=123';
|
let url = 'http://api.workadventure.localhost/dump?token='+ADMIN_API_TOKEN;
|
||||||
if (fs.existsSync('/project')) {
|
if (fs.existsSync('/project')) {
|
||||||
// We are inside a container. Let's use a direct route
|
// We are inside a container. Let's use a direct route
|
||||||
url = 'http://back:8080/dump?token=123';
|
url = 'http://back:8080/dump?token='+ADMIN_API_TOKEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (await axios({
|
return (await axios({
|
||||||
|
Loading…
Reference in New Issue
Block a user