Update README.md
This commit is contained in:
21
README.md
21
README.md
@@ -24,7 +24,7 @@ cargo install cargo-generate
|
||||
Generate a new project from this template:
|
||||
|
||||
```bash
|
||||
cargo generate --git <your-template-repo-url>
|
||||
cargo generate --git https://gitea.fasharp.io/fa-sharp/axum-template
|
||||
```
|
||||
|
||||
You'll be prompted for:
|
||||
@@ -35,16 +35,9 @@ You'll be prompted for:
|
||||
- **Default log level**: trace, debug, info, warn, or error
|
||||
- **Include aide**: Whether to include OpenAPI documentation support
|
||||
|
||||
### Manual Setup
|
||||
|
||||
1. Clone or download this repository
|
||||
2. Update `Cargo.toml` with your project name and details
|
||||
3. Copy `.env.example` to `.env` and configure your environment variables
|
||||
4. Run `cargo build`
|
||||
|
||||
## Configuration
|
||||
|
||||
Configuration is loaded from environment variables. The prefix is configurable during template generation.
|
||||
Configuration is loaded from environment variables and validated in the `config.rs` file. The variable prefix is configurable during template generation.
|
||||
|
||||
Example with `APP` prefix:
|
||||
|
||||
@@ -58,18 +51,20 @@ APP_PORT=8080
|
||||
APP_LOG_LEVEL=info
|
||||
```
|
||||
|
||||
In development, you can use the `.env` file.
|
||||
In development, you can use the `.env` file to set environment variables.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
.
|
||||
├── src/
|
||||
│ ├── main.rs # Entry point, server setup
|
||||
│ ├── lib.rs # App initialization
|
||||
│ ├── routes/ # API routes
|
||||
│ ├── config.rs # Configuration management
|
||||
│ └── state.rs # Application state
|
||||
│ ├── lib.rs # Axum server setup
|
||||
│ ├── main.rs # Entry point
|
||||
│ └── state.rs # Axum server state
|
||||
├── Cargo.toml # Dependencies
|
||||
├── .env # Local environment variables
|
||||
└── .env.example # Example environment variables
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user