Skip to content

Commit

Permalink
[@dhealthdapps/frontend] fix: update websocket environment and add BA…
Browse files Browse the repository at this point in the history
…CKEND_DOMAIN variable
  • Loading branch information
evias committed Jan 4, 2023
1 parent d3cfccc commit 11b9ced
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions runtime/dapp-frontend-vue/.env-sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
VUE_APP_BACKEND_URL=http://localhost:7903
VUE_APP_BACKEND_DOMAIN=localhost:7903
VUE_APP_FRONTEND_URL=http://localhost:8080
VUE_APP_FRONTEND_DOMAIN=localhost
VUE_APP_FRONTEND_PORT=8080
Expand Down
2 changes: 1 addition & 1 deletion runtime/dapp-frontend-vue/src/registerServiceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { register } from "register-service-worker";

if (process.env.NODE_ENV === "production") {
register(`${process.env.BASE_URL}service-worker.js`, {
register(`${process.env.VUE_APP_FRONTEND_URL}/service-worker.js`, {
ready() {
console.log(
"[INFO] dHealth dApp is being served from cache by a service worker.\n" +
Expand Down
2 changes: 1 addition & 1 deletion runtime/dapp-frontend-vue/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const createRouter = ($store: any): VueRouter => {
// configures the `vue-router` routes
const router = new VueRouter({
mode: "history",
base: process.env.BASE_URL,
/* base: "/" */
routes: [
...dynamicRoutes,
{
Expand Down
2 changes: 1 addition & 1 deletion runtime/dapp-frontend-vue/src/state/store/AppModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const AppModule = {
try {
const response = await handler.getConfig();
context.commit("setConfig", response);
context.commit("auth/setAuthRegistry", response.authRegistry, {
context.commit("auth/setAuthRegistry", response.authRegistry[0], {
root: true,
});
return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ export default class LoginScreen extends MetaView {
public async mounted() {
this.qrConfig = this.createLoginQRCode();

this.wsConnection = new WebSocket(`ws://${process.env.BACKEND_DOMAIN}:${process.env.BACKEND_PORT}/ws`);
this.wsConnection = new WebSocket(
`ws://${process.env.VUE_APP_BACKEND_DOMAIN}/ws`
);

this.wsConnection.onopen = function () {
console.log("Successfully connected to the echo websocket server...");
Expand Down

0 comments on commit 11b9ced

Please sign in to comment.