| Crates.io | jserve |
| lib.rs | jserve |
| version | 0.1.1 |
| created_at | 2025-03-26 05:37:39.643188+00 |
| updated_at | 2025-03-26 05:44:05.557282+00 |
| description | A Rust-based server application using Actix-Web. |
| homepage | https://dreamcatcher45.github.io/jserve/ |
| repository | https://github.com/dreamcatcher45/jserve |
| max_upload_size | |
| id | 1606191 |
| size | 61,167 |
A lightning-fast, RESTful JSON server built with Rust ⚙️, designed for prototyping and mock APIs. Store and manage data effortlessly using a simple JSON file! 📁
🌐 Full REST API support (GET/POST/PUT/DELETE)
🛠️ CRUD operations with JSON validation
⚡ Real-time persistence to JSON file
🔒 Thread-safe in-memory caching
🚦 Auto-create missing JSON files
📡 Dynamic endpoint discovery
🔧 Configurable port & file path
📡 Built with async Actix-Web framework
Using Cargo:
# Install directly from crates.io
cargo install jserve
Pre-built Binaries (Recommended):
# Download (Run in PowerShell)
curl -LO https://github.com/dreamcatcher45/jserve/releases/latest/download/jserve-windows.exe
# Rename and make available system-wide (optional)
mv jserve-windows.exe jserve.exe
mkdir -p $HOME\bin
move .\jserve.exe $HOME\bin # Add $HOME\bin to PATH
# Download
curl -LO https://github.com/dreamcatcher45/jserve/releases/latest/download/jserve-linux
# Make executable and install
chmod +x jserve-linux
sudo mv jserve-linux /usr/local/bin/jserve
# Download
curl -LO https://github.com/dreamcatcher45/jserve/releases/latest/download/jserve-macos
# Install globally
chmod +x jserve-macos
sudo mv jserve-macos /usr/local/bin/jserve
# Start server with your JSON file
jserve -f db.json -p 3000
# Access from any directory after PATH setup!
Path Configuration 🌍:
PATH environment variable/usr/local/bin or add custom directory to $PATHNo Rust installation required! Just download and run 🎉
Prerequisites:
# Clone repository
git clone https://github.com/dreamcatcher45/jserve.git
cd jserve
# Build and run (release mode recommended)
cargo build --release
./target/release/jserve -f db.json -p 3000
Sample Requests:
# Get all posts
curl http://localhost:3000/posts
# Get specific post
curl http://localhost:3000/posts/1
# Create new post
curl -X POST -H "Content-Type: application/json" \
-d '{"id":"4","title":"New Post"}' \
http://localhost:3000/posts
# Update post
curl -X PUT -H "Content-Type: application/json" \
-d '{"id":"1","title":"Updated Title"}' \
http://localhost:3000/posts/1
# Delete post
curl -X DELETE http://localhost:3000/posts/1
Automatic Endpoints:
http://localhost:3000/{collection_name}
Based on your JSON file structure (e.g., /posts, /activities from sample db.json)
We 💖 contributions! Here's how to help:
git checkout -b feature/amazing)git commit -m 'Add amazing feature')git push origin feature/amazing)Development Setup:
cargo run -- -f db.json # Development mode
cargo test # Run tests
Please follow Rust coding conventions and document complex logic.
MIT License - see LICENSE file for details