Skip to content

Commit 73e6822

Browse files
committed
renaming launch url base to make use case more obvious
1 parent 43d8995 commit 73e6822

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

cts/.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ HOSTNAME=localhost
33
PLAYER_ROOT_PATH=/player
44
PLAYER_BASE_URL=http://player:3398/player
55
PLAYER_CONTENT_URL=http://localhost/player/content
6-
PLAYER_LAUNCH_URL_BASE=http://localhost/player
6+
# PLAYER_STANDALONE_LAUNCH_URL_BASE=http://localhost/player
77
PLAYER_KEY=cts
88
PLAYER_SECRET=player-secret
99
PLAYER_TOKEN_SECRET=player-token-secret

cts/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ services:
104104
- API_KEY=${PLAYER_KEY}
105105
- API_SECRET=${PLAYER_SECRET}
106106
- PLAYER_API_ROOT=${PLAYER_ROOT_PATH}
107-
- PLAYER_LAUNCH_URL_BASE
107+
- PLAYER_STANDALONE_LAUNCH_URL_BASE
108108
networks:
109109
- public
110110

cts/service/plugins/routes/v1/sessions.js

+5
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ module.exports = {
159159
playerFetch = playerAuLaunchUrlParsed.searchParams.get("fetch");
160160
let sessionId;
161161

162+
console.log("PLAYER FETCH:", playerFetch);
163+
162164
try {
163165
const sessionInsert = await db.insert(
164166
{
@@ -362,6 +364,8 @@ module.exports = {
362364
let fetchResponse,
363365
fetchResponseBody;
364366

367+
console.log("POSTING FETCH:", session.playerFetch);
368+
365369
try {
366370
fetchResponse = await Wreck.request(
367371
"POST",
@@ -370,6 +374,7 @@ module.exports = {
370374
fetchResponseBody = await Wreck.read(fetchResponse, {json: true});
371375
}
372376
catch (ex) {
377+
console.error(ex);
373378
throw Boom.internal(new Error(`Failed to request fetch url from player: ${ex}`));
374379
}
375380

player/.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ LRS_XAPI_VERSION=1.0.3
1414

1515
## Default is empty, add if necessary for nginx config
1616
PLAYER_API_ROOT=
17-
PLAYER_LAUNCH_URL_BASE=
17+
PLAYER_STANDALONE_LAUNCH_URL_BASE=

player/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ services:
4141
- DATABASE_NAME=catapult_player
4242
- FIRST_TENANT_NAME
4343
- PLAYER_API_ROOT=${PLAYER_ROOT_PATH}
44-
- PLAYER_LAUNCH_URL_BASE
44+
- PLAYER_STANDALONE_LAUNCH_URL_BASE
4545
- HOST_PORT
4646
rdbms:
4747
image: mysql:8.0.31

player/service/plugins/routes/v1/courses.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ module.exports = {
744744
}
745745
};
746746

747-
let launchURLBase = (process.env.PLAYER_LAUNCH_URL_BASE || `${protocol}//${req.url.host}${rootPath}`);
747+
let launchURLBase = (process.env.PLAYER_STANDALONE_LAUNCH_URL_BASE || `${protocol}//${req.url.host}${rootPath}`);
748748
let endpoint = `${launchURLBase}/lrs`;
749749

750750
// //Debug messages for troubleshooting host and path issuse - MB
@@ -824,7 +824,7 @@ module.exports = {
824824

825825
}
826826
catch (ex) {
827-
827+
console.error(ex);
828828
throw Boom.internal(new Error(`Failed request to set LMS.LaunchData state document: ${ex}`));
829829
}
830830

@@ -918,6 +918,7 @@ module.exports = {
918918
session.id = sessionInsertResult[0];
919919
}
920920
catch (ex) {
921+
console.error(ex);
921922
throw Boom.internal(new Error(`Failed to insert session: ${ex}`));
922923
}
923924

0 commit comments

Comments
 (0)