Skip to content

Commit

Permalink
Merge pull request doubtfire-lms#840 from ublefo/devcontainer-reverse…
Browse files Browse the repository at this point in the history
…-proxy
  • Loading branch information
jakerenzella authored May 18, 2024
2 parents f19eabd + 65aaa93 commit 91bcf45
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
26 changes: 25 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,41 @@
"optimization": false,
"extractLicenses": false,
"sourceMap": true
},
"devcontainer": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/app/config/constants/apiURL.ts",
"with": "src/app/config/constants/apiURL.devcontainer.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"buildTarget": "doubtfire:build"
"buildTarget": "doubtfire:build",
"port": 4200,
"host": "0.0.0.0"
},
"configurations": {
"development": {
"buildTarget": "doubtfire:build:development"
},
"production": {
"buildTarget": "doubtfire:build:production"
},
"docker": {
"buildTarget": "doubtfire:build:development"
},
"devcontainer": {
"buildTarget": "doubtfire:build:devcontainer",
"port": 4201,
"host": "localhost"
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions env.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ module.exports = {
docker: {
// API URL should use the DF_DOCKER_MACHINE_IP set
API_URL: 'http://' + process.env.DF_DOCKER_MACHINE_IP + ':3000/api'
},

devcontainer: {
// API URL should use the DF_DOCKER_MACHINE_IP set
API_URL: 'http://' + process.env.DF_DOCKER_MACHINE_IP + ':4200/api'
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "doubtfire",
"version": "8.0.0-4",
"homepage": "http://github.com/doubtfire-lms/",
"homepage": "https://github.com/doubtfire-lms/",
"description": "Learning and feedback tool.",
"license": "AGPL-3.0",
"repository": {},
Expand All @@ -14,7 +14,7 @@
"build:angular17": "ng build",
"lint:fix": "ng lint --fix",
"lint": "ng lint",
"serve:angular17": "export NODE_OPTIONS=--max_old_space_size=4096 && ng serve --host 0.0.0.0",
"serve:angular17": "export NODE_OPTIONS=--max_old_space_size=4096 && ng serve --configuration $NODE_ENV",
"start": "npm-run-all -l -s build:angular1 -p watch:angular1 serve:angular17",
"watch:angular1": "grunt delta",
"deploy:build2api": "ng build --delete-output-path=true --optimization=true --configuration production --output-path dist",
Expand Down
2 changes: 2 additions & 0 deletions src/app/config/constants/apiURL.devcontainer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const API_URL = `${window.location.origin}/api`;
export default API_URL;

0 comments on commit 91bcf45

Please sign in to comment.