Skip to content

Commit

Permalink
Changed webapp ports
Browse files Browse the repository at this point in the history
  • Loading branch information
UO282476 authored and UO282476 committed May 1, 2023
1 parent b3e898f commit c110cff
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion restapi/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let host = process.env.host || "localhost";
api.use(
cors({
credentials: true,
origin: ["https://" + host, "http://" + host],
origin: ["https://" + host + ":3443", "http://" + host + ":3080"],
allowedHeaders: ["Content-Type", "Authorization"],
preflightContinue: true,
})
Expand Down
4 changes: 2 additions & 2 deletions restapi/src/repositories/pods/PodSessionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class PodSessionManager {
},
});
} catch (err) {
res.redirect("https://" + host + ":443/login/fail");
res.redirect("https://" + host + ":3443/login/fail");
}
}

Expand All @@ -57,7 +57,7 @@ export class PodSessionManager {

await PodManager.permissionManager.setupPod(sessionId);

return res.redirect("http://" + host + ":80/map");
return res.redirect("http://" + host + ":3080/map");
}

public async logout(req: any, res: Response): Promise<any> {
Expand Down
2 changes: 1 addition & 1 deletion webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
#Install the dependencies
RUN npm install

ARG API_URI="https://20.38.6.214:443/api"
ARG API_URI="https://20.38.6.214:3443/api"
ENV REACT_APP_API_URI=$API_URI

ARG HOST_URI="20.38.6.214"
Expand Down
4 changes: 2 additions & 2 deletions webapp/e2e/steps/friendsmanagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineFeature(feature, test => {
page = await browser.newPage();

await page
.goto("http://localhost:80", {
.goto("http://localhost:3080", {
waitUntil: "networkidle0",
})
.catch(() => { });
Expand Down Expand Up @@ -53,7 +53,7 @@ defineFeature(feature, test => {
await page.waitForSelector('a[href="/map"]')
await page.waitForSelector('img')
//Hago clic en el dropdown de perfil
await page.goto("http://localhost:80/friends")
await page.goto("http://localhost:3080/friends")

//Espero a que se cargue la pagina de añadir lugar

Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/login.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineFeature(feature, test => {
page = await browser.newPage();

await page
.goto("http://localhost:80", {
.goto("http://localhost:3080", {
waitUntil: "networkidle0",
})
.catch(() => { });
Expand Down
4 changes: 2 additions & 2 deletions webapp/e2e/steps/profile.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineFeature(feature, test => {
page = await browser.newPage();

await page
.goto("http://localhost:80", {
.goto("http://localhost:3080", {
waitUntil: "networkidle0",
})
.catch(() => { });
Expand Down Expand Up @@ -53,7 +53,7 @@ defineFeature(feature, test => {
await page.waitForSelector('a[href="/map"]')
await page.waitForSelector('img')
//Hago clic en el dropdown de perfil
await page.goto("http://localhost:80/profile")
await page.goto("http://localhost:3080/profile")

//Espero a que se cargue la pagina de añadir lugar

Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"start": "node server.js",
"build": "react-scripts build",
"test": "react-scripts test --transformIgnorePatterns \"node_modules/(?!ol)/\" --coverage",
"test:e2e": "start-server-and-test 'npm --prefix ../restapi run prod' http://localhost:5080/api prod 80 \"cd e2e && jest\"",
"test:e2e": "start-server-and-test 'npm --prefix ../restapi run prod' http://localhost:5080/api prod 3080 \"cd e2e && jest\"",
"eject": "react-scripts eject",
"prod": "node server.js"
},
Expand Down
4 changes: 2 additions & 2 deletions webapp/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const express = require('express');
let expressStaticGzip = require('express-static-gzip');
const path = require('path');

const portHttp = 80;
const portHttps = 443;
const portHttp = 3080;
const portHttps = 3443;

//Load certificates
let privateKey = fs.readFileSync("certificates/host.key");
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/mainPage/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function LoginForm(props: LoginFormProps): JSX.Element {
const [cookies, setCookie] = useCookies();

const [idp, setIdp] = useState("");
const [currentUrl, setCurrentUrl] = useState("http://localhost:443/map");
const [currentUrl, setCurrentUrl] = useState("http://localhost:3443/map");

const [notificationStatus, setNotificationStatus] = useState(false);
const [notification, setNotification] = useState<NotificationType>({ severity: 'warning', message: '' });
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/mainPage/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ function LoggedNavbar(props: LogoutProps) {
let host = process.env.host || "localhost";
let url = window.location.href;
if (url.includes("https")) {
return "https://" + host + ":443/map"
return "https://" + host + ":3443/map"
} else {
return "http://" + host + ":80/map"
return "http://" + host + ":3080/map"
}

}
Expand Down

0 comments on commit c110cff

Please sign in to comment.