add file browser component and widget
This commit is contained in:
39
examples/file_browser_demo/run-mock-server.sh
Executable file
39
examples/file_browser_demo/run-mock-server.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run Mock Server Script
|
||||
# This script starts the Rust mock server for testing the file browser component
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting Mock File Server..."
|
||||
echo "📁 This server provides the same API as src/files.py for testing"
|
||||
echo ""
|
||||
|
||||
# Change to mock server directory
|
||||
cd "$(dirname "$0")/mock-server"
|
||||
|
||||
# Check if Rust is installed
|
||||
if ! command -v cargo &> /dev/null; then
|
||||
echo "❌ Error: Rust/Cargo is not installed"
|
||||
echo "Please install Rust from https://rustup.rs/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build and run the mock server
|
||||
echo "🔨 Building mock server..."
|
||||
cargo build --release
|
||||
|
||||
echo "🌐 Starting server on http://localhost:3001"
|
||||
echo "📋 Available endpoints:"
|
||||
echo " GET /files/list/<path> - List directory contents"
|
||||
echo " POST /files/dirs/<path> - Create directory"
|
||||
echo " DELETE /files/delete/<path> - Delete file/directory"
|
||||
echo " POST /files/upload - Upload file (TUS)"
|
||||
echo " GET /files/download/<path> - Download file"
|
||||
echo " GET /health - Health check"
|
||||
echo ""
|
||||
echo "💡 Use Ctrl+C to stop the server"
|
||||
echo ""
|
||||
|
||||
# Run the server
|
||||
cargo run --release
|
Reference in New Issue
Block a user