diff --git a/.gitignore b/.gitignore index 241c0f6e54e4da30c80a69c553d9d43e5b04f2fd..e8b57521c7927d643fa8e6012b7528072f0b260a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ .env config.json/ +resources/ diff --git a/models/Invite.js b/models/invite.js similarity index 100% rename from models/Invite.js rename to models/invite.js diff --git a/output.log b/output.log new file mode 100644 index 0000000000000000000000000000000000000000..819b52d215874f85b04db61021421ebce210f6c7 --- /dev/null +++ b/output.log @@ -0,0 +1,8 @@ +MongoDB URI: mongodb+srv://admin:lim1234!!@goodmeeting.vkniz.mongodb.net/ +(node:44244) [MONGODB DRIVER] Warning: useNewUrlParser is a deprecated option: useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version +(Use `node --trace-warnings ...` to show where the warning was created) +(node:44244) [MONGODB DRIVER] Warning: useUnifiedTopology is a deprecated option: useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version +�� MongoDB �곌껐 �깃났 +Rdb�곗씠�곕쿋�댁뒪 �곌껐 �깃났. +紐⑤뱺 紐⑤뜽�� �깃났�곸쑝濡� �숆린�붾릺�덉뒿�덈떎. +Server is running on 8080 diff --git a/resources/firebase/yanawa-89d9d-firebase-adminsdk-d1inm-24566bf0b9.json b/resources/firebase/yanawa-89d9d-firebase-adminsdk-d1inm-24566bf0b9.json new file mode 100644 index 0000000000000000000000000000000000000000..b397868592a27271a9c3a94f6cd99523245448ad --- /dev/null +++ b/resources/firebase/yanawa-89d9d-firebase-adminsdk-d1inm-24566bf0b9.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "yanawa-89d9d", + "private_key_id": "24566bf0b90cae5dfabe6d1f4994f17d57a816a6", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCht11GDE9ixnOC\nVLgohfV53E6f4DxuOfaQ88ZIEo7gCgwI36XweE7swyLA3KLYGP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e6ahV/XkzA4aNYYkDz6cD6Xc5qW+TgRTWh86zCbtu7yuX186mWW6XU5moTQlzd\nISRRgyLOjsn4PrXTJj7c9e5l+/gc53eQiOjJ4+AAnoGbMbJmpK8GOk6zAoGAN1tf\nNt5bFqPwXqWwJa333cjfHKrlieipTYJboG0jSuaqsEiLv57sKQ6NlIE08fFq3N6p\nkjIX9hNb5gJ3+c+04v5qsNWf8PQeICUc3gRel+LsHsknOGbXgOjKOpNrn3XDCyWO\nmn7IRlaI6elT97RWMC0dwgrGWOueamxQrUSFKZ0CgYEAzg0NYIl1PaygbqDY/F+K\ngOSIA/PblcQOTwdZE9TtTotjeqFrOYjIEjUVMNJaWAUXFmkHwjGNL+y3nwHokWpN\n0igbTAxxl6uHG24SJsIPG6GlvVgOWvHjQ2n10iXPJNOz4NsBVC+F1Wh7WU+2dhVH\nN0uplgmlvAItjFmCZK66pjc=\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-d1inm@yanawa-89d9d.iam.gserviceaccount.com", + "client_id": "116723201622055361661", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-d1inm%40yanawa-89d9d.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/schemas/ChatRooms.js b/schemas/chatRooms.js similarity index 100% rename from schemas/ChatRooms.js rename to schemas/chatRooms.js diff --git a/start.sh b/start.sh new file mode 100755 index 0000000000000000000000000000000000000000..00e9bb6ef347484cfd135e68776c215f20ef9957 --- /dev/null +++ b/start.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Define application file names +APP_JS="app.js" +WS_SERVER_JS="wsServer.js" + +# Find and kill processes for app.js +APP_PID=$(pgrep -f "node .*${APP_JS}") +if [ -n "$APP_PID" ]; then + echo "Stopping ${APP_JS} with PID: $APP_PID" + kill -9 "$APP_PID" +else + echo "No running process found for ${APP_JS}" +fi + +# Find and kill processes for wsServer.js +WS_SERVER_PID=$(pgrep -f "node .*${WS_SERVER_JS}") +if [ -n "$WS_SERVER_PID" ]; then + echo "Stopping ${WS_SERVER_JS} with PID: $WS_SERVER_PID" + kill -9 "$WS_SERVER_PID" +else + echo "No running process found for ${WS_SERVER_JS}" +fi + +# Start app.js with nohup +echo "Starting ${APP_JS}..." +nohup node "${APP_JS}" > output.log 2>&1 & +echo "${APP_JS} started with PID: $!" + +# Start wsServer.js with nohup +echo "Starting ${WS_SERVER_JS}..." +nohup node "${WS_SERVER_JS}" > weblog.log 2>&1 & +echo "${WS_SERVER_JS} started with PID: $!" + diff --git a/weblog.log b/weblog.log new file mode 100644 index 0000000000000000000000000000000000000000..2ac6636d8e84aa62e66d37d5dc3cf29688bbfc9a --- /dev/null +++ b/weblog.log @@ -0,0 +1,22 @@ +node:internal/modules/cjs/loader:1143 + throw err; + ^ + +Error: Cannot find module './resources/firebase/yanawa-89d9d-firebase-adminsdk-d1inm-24566bf0b9.json' +Require stack: +- /home/ubuntu/webback/wsServer.js + at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15) + at Module._load (node:internal/modules/cjs/loader:981:27) + at Module.require (node:internal/modules/cjs/loader:1231:19) + at require (node:internal/modules/helpers:177:18) + at Object.<anonymous> (/home/ubuntu/webback/wsServer.js:18:37) + at Module._compile (node:internal/modules/cjs/loader:1364:14) + at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) + at Module.load (node:internal/modules/cjs/loader:1203:32) + at Module._load (node:internal/modules/cjs/loader:1019:12) + at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) { + code: 'MODULE_NOT_FOUND', + requireStack: [ '/home/ubuntu/webback/wsServer.js' ] +} + +Node.js v18.20.5