blog/backend/README.md
SquidSpirit d58a7d1a37
All checks were successful
Frontend CI / build (push) Successful in 1m9s
BLOG-78 feat: implement image upload and retrieval feature
This commit introduces the capability to upload and serve images.

A new `image` feature module has been added to the backend, following the existing clean architecture pattern.

- Implements `POST /image/upload` for uploading image files.
- Implements `GET /image/{id}` for retrieving an image by its ID.
- Adds a new `image` table to the database to store image metadata.
- Image data is stored in the file system. The path can be configured via the `STORAGE_PATH` environment variable.
2025-07-27 11:51:41 +08:00

42 lines
503 B
Markdown

# Backend
## Development
### SQL Migration
1. Install sqlx
```bash
cargo install sqlx-cli
```
2. Run migration
```bash
sqlx migrate run
```
### Run Project
1. Prepare for sql schema setup
```bash
cargo sqlx prepare --workspace
```
2. Run the server
```bash
RUST_LOG=debug cargo run
```
3. (Optional) Hot restart
1. Install `watchexec`
2. Run the server with `watchexec`
```bash
RUST_LOG=debug watchexec -e rs -r 'cargo run'
```