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/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