-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
j.krol
committed
Nov 25, 2023
1 parent
cd83426
commit 0a279af
Showing
16 changed files
with
165 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,30 +14,30 @@ jobs: | |
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- uses: isbang/[email protected] | ||
with: | ||
compose-file: "compose.yml" | ||
- name: Wait for containers to start | ||
run: | | ||
sleep 18 | ||
docker run \ | ||
--rm \ | ||
--network mercury-project_default \ | ||
alpine/curl -o /dev/null --retry 3 --retry-connrefused backend:5000 | ||
- name: Test the backend | ||
run: cd backend; npm i && npm run test run | ||
|
||
- name: Format files | ||
run: cd ..; npm i && npm run prettier:fix | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Apply formatting changes | ||
branch: ${{ github.head_ref }} | ||
- uses: isbang/[email protected] | ||
with: | ||
compose-file: "compose.yml" | ||
|
||
- name: Wait for containers to start | ||
run: | | ||
sleep 18 | ||
docker run \ | ||
--rm \ | ||
--network mercury-project_default \ | ||
alpine/curl -o /dev/null --retry 3 --retry-connrefused backend:5000 | ||
- name: Test the backend | ||
run: cd backend; npm i && npm run test run | ||
|
||
- name: Format files | ||
run: cd ..; npm i && npm run prettier:fix | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Apply formatting changes | ||
branch: ${{ github.head_ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,4 +83,4 @@ const userData = [ | |
}, | ||
]; | ||
|
||
export default userData; | ||
export default userData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export default interface CreateMeetingDto { | ||
ownerId: string; | ||
guestId: string; | ||
} | ||
ownerId: string; | ||
guestId: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import "./httpServer"; | ||
import "./socketServer"; | ||
import "./socketServer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ export default interface User { | |
password: string; | ||
friend_ids?: number[]; | ||
chats?: Chat[]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import servers from "./server"; | ||
import dotenv from "dotenv"; | ||
import { Socket } from "socket.io"; | ||
import {decodeSocketData} from "./misc/jwt"; | ||
const {io, app} = servers; | ||
import { decodeSocketData } from "./misc/jwt"; | ||
const { io, app } = servers; | ||
|
||
dotenv.config(); | ||
const linkSecret = process.env.LINK_SECRET; | ||
|
||
io.on("connection", (socket: Socket) => { | ||
const handshakeData = socket.handshake.auth.jwt; | ||
const decodedData = decodeSocketData(handshakeData, linkSecret!); | ||
if (!decodedData) { | ||
socket.disconnect(); | ||
return; | ||
} | ||
|
||
}); | ||
const handshakeData = socket.handshake.auth.jwt; | ||
const decodedData = decodeSocketData(handshakeData, linkSecret!); | ||
if (!decodedData) { | ||
socket.disconnect(); | ||
return; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ services: | |
build: ./frontend | ||
ports: | ||
- 5173:80 | ||
|
||
backend: | ||
build: ./backend | ||
env_file: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
class DataService { | ||
|
||
private url: string = "http://localhost:5000"; | ||
|
||
async fetchData(endpoint: string, method: string, options = {}) { | ||
try { | ||
const response = await fetch(this.url + endpoint, { ...options, method }); | ||
const data = await response.json(); | ||
return data; | ||
} catch (error) { | ||
console.error("Error ocurred during fetch data:", error); | ||
throw error; | ||
} | ||
try { | ||
const response = await fetch(this.url + endpoint, { ...options, method }); | ||
const data = await response.json(); | ||
return data; | ||
} catch (error) { | ||
console.error("Error ocurred during fetch data:", error); | ||
throw error; | ||
} | ||
} | ||
|
||
} | ||
|
||
export default new DataService(); |
Oops, something went wrong.