diff --git a/modules/file-creator-module.sh b/modules/file-creator-module.sh index c840e6c..79ead3a 100644 --- a/modules/file-creator-module.sh +++ b/modules/file-creator-module.sh @@ -1835,6 +1835,28 @@ function copy_module_files() { fi done + # Copy main server files + echo "Copying main server files..." + + # server.js + if [ -f "${SCRIPT_DIR}/server.js" ]; then + cp "${SCRIPT_DIR}/server.js" "$INSTALL_DIR/" + log "INFO" "Copied main server file: server.js" + chown "$USER:$USER" "$INSTALL_DIR/server.js" + chmod 644 "$INSTALL_DIR/server.js" + else + log "ERROR" "Main server file server.js not found in source directory" + return 1 + fi + + # server-endpoints.js (if it exists) + if [ -f "${SCRIPT_DIR}/server-endpoints.js" ]; then + cp "${SCRIPT_DIR}/server-endpoints.js" "$INSTALL_DIR/" + log "INFO" "Copied API endpoints file: server-endpoints.js" + chown "$USER:$USER" "$INSTALL_DIR/server-endpoints.js" + chmod 644 "$INSTALL_DIR/server-endpoints.js" + fi + # Function to create bidirectional symlinks for module compatibility create_bidirectional_links() { local hyphenated="$1"