diff --git a/backend/src/data/users.ts b/backend/src/data/users.ts index 5a64adc6..3891e7c4 100644 --- a/backend/src/data/users.ts +++ b/backend/src/data/users.ts @@ -1,6 +1,5 @@ const userData = [ { - "nick": "boejiden", "password": "sleepyjoe", "first_name": "Joe", "last_name": "Biden", @@ -12,7 +11,6 @@ const userData = [ "chats": [], }, { - "nick": "adamos", "password": "mysz888", "first_name": "Adam", "last_name": "MaĆysz", @@ -24,7 +22,6 @@ const userData = [ "chats": [], }, { - "nick": "budyn1989", "password": "kaczorlove", "first_name": "Andrew", "last_name": "Duda", @@ -36,7 +33,6 @@ const userData = [ "chats": [], }, { - "nick": "mentosdestroyer4", "password": "mmmcow", "first_name": "Kuba", "last_name": "Nowak", @@ -48,7 +44,6 @@ const userData = [ "chats": [], }, { - "nick": "elonmusk", "password": "DogeToTheMOON", "first_name": "Elon", "last_name": "Musk", @@ -60,7 +55,6 @@ const userData = [ "chats": [], }, { - "nick": "nowayno3", "password": "432525n", "first_name": "Olivia", "last_name": "Smith", @@ -71,7 +65,6 @@ const userData = [ "chats": [], }, { - "nick": "rEptiliAn69", "password": "metaverse4ever", "first_name": "Mark", "last_name": "Zuckerberg", diff --git a/backend/src/index.ts b/backend/src/index.ts index ffb2d8ec..368c1ddb 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -20,7 +20,6 @@ const corsOptions = { app.use(cors(corsOptions)); app.use((req, res, next) => { - res.header("Access-Control-Allow-Origin", "http://127.0.0.1:5173"); res.header("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE"); res.header("Access-Control-Allow-Headers", "Content-Type"); next(); diff --git a/backend/src/models/User.ts b/backend/src/models/User.ts index 7e6f957b..b8226ab0 100644 --- a/backend/src/models/User.ts +++ b/backend/src/models/User.ts @@ -1,7 +1,6 @@ import Chat from "./Chat"; export default interface User { - nick: string; password: string; first_name: string; last_name: string; diff --git a/backend/test/userEndpoints.test.ts b/backend/test/userEndpoints.test.ts index 4d5a45db..d26c79a1 100644 --- a/backend/test/userEndpoints.test.ts +++ b/backend/test/userEndpoints.test.ts @@ -4,7 +4,6 @@ let userId: number; test("Create user", async () => { const userData = { - nick: "Tommy", password: "12345", first_name: "Tom", last_name: "Hanks", @@ -40,7 +39,6 @@ test("Fetch user by ID", async () => { test("Update user by ID", async () => { const userUpdateData = { - nick: "Tommy", password: "54321", first_name: "Tommy", last_name: "Hanks", @@ -82,7 +80,7 @@ test("Get user's friends", async () => { expect(usersStatus).toBe("ok"); const zuck = usersResponseData.users.find( - (user: any) => user.nick == "rEptiliAn69", + (user: any) => user.mail == "goodboymark1@meta.com", ); const zuckId = zuck.id; @@ -119,7 +117,7 @@ test("Search users", async () => { expect(usersStatus).toBe("ok"); const zuck = usersResponseData.users.find( - ([user, _score]: any) => user.nick == "rEptiliAn69", + ([user, _score]: any) => user.mail == "goodboymark1@meta.com", ); expect(zuck).toBeDefined(); diff --git a/frontend/Dockerfile b/frontend/Dockerfile index bed131a9..bd4260c3 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -7,4 +7,5 @@ RUN npm i && npm run build FROM nginx:1.25.3-alpine COPY --from=base /home/node/app/dist /usr/share/nginx/html -EXPOSE 80 +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 \ No newline at end of file diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 00000000..fd5dea24 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + try_files $uri /index.html; + } +} diff --git a/frontend/src/components/LoginBox.tsx b/frontend/src/components/LoginBox.tsx index b0b09604..90e5de86 100644 --- a/frontend/src/components/LoginBox.tsx +++ b/frontend/src/components/LoginBox.tsx @@ -36,11 +36,11 @@ function LoginBox() { className=" medium:w-[25vw] flex flex-col gap-2 bg-my-dark p-10 px-20 rounded-xl" id="login-box" > -