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:
|
Generate a new project from this template:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo generate --git <your-template-repo-url>
|
cargo generate --git https://gitea.fasharp.io/fa-sharp/axum-template
|
||||||
```
|
```
|
||||||
|
|
||||||
You'll be prompted for:
|
You'll be prompted for:
|
||||||
@@ -35,16 +35,9 @@ You'll be prompted for:
|
|||||||
- **Default log level**: trace, debug, info, warn, or error
|
- **Default log level**: trace, debug, info, warn, or error
|
||||||
- **Include aide**: Whether to include OpenAPI documentation support
|
- **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
|
||||||
|
|
||||||
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:
|
Example with `APP` prefix:
|
||||||
|
|
||||||
@@ -58,18 +51,20 @@ APP_PORT=8080
|
|||||||
APP_LOG_LEVEL=info
|
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
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
.
|
.
|
||||||
├── src/
|
├── src/
|
||||||
│ ├── main.rs # Entry point, server setup
|
│ ├── routes/ # API routes
|
||||||
│ ├── lib.rs # App initialization
|
|
||||||
│ ├── config.rs # Configuration management
|
│ ├── 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
|
├── Cargo.toml # Dependencies
|
||||||
|
├── .env # Local environment variables
|
||||||
└── .env.example # Example environment variables
|
└── .env.example # Example environment variables
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user