mirror of
https://github.com/kristoferssolo/Axium.git
synced 2025-10-21 16:00:34 +00:00
A few typos fixed, fixed a bug with the migrator.
This commit is contained in:
parent
6258587d01
commit
96f8e9b534
BIN
documentation/images/cli.png
Normal file
BIN
documentation/images/cli.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@ -1,6 +1,5 @@
|
||||
# Core
|
||||
|
||||
The `core` module contains the fundamental components for setting up and configuring the API backend. It includes server creation, environment configuration management, and middleware layers that enhance the overall performance and observability of the API.
|
||||
The `core` module contains the fundamental components for setting up and configuring Axium. It includes server creation, environment configuration management, and middleware layers that enhance the overall performance and observability of the API.
|
||||
|
||||
## Contributing
|
||||
Ensure new middleware is well-documented, includes error handling, and integrates with the existing architecture.
|
||||
|
||||
@ -121,20 +121,19 @@ pub async fn run_database_migrations(pool: &PgPool) -> Result<(), DatabaseError>
|
||||
|
||||
// Initialize migrator with production safety checks
|
||||
let migrator = Migrator::new(migrations_path)
|
||||
.await
|
||||
.map_err(|e| DatabaseError::MigrationError(e))?;
|
||||
.await
|
||||
.map_err(|e| DatabaseError::MigrationError(e))?;
|
||||
|
||||
// Execute migrations in transaction if supported
|
||||
// Skip migrations execution in production, just print a message
|
||||
if env::var("ENVIRONMENT").unwrap_or_else(|_| "development".into()) == "production" {
|
||||
println!("🛑 Migration execution blocked in production.");
|
||||
return Err(DatabaseError::ConfigError(
|
||||
"🛑 Direct migrations disabled in production.".to_string()
|
||||
));
|
||||
println!("🛑 Migration execution skipped in production.");
|
||||
return Ok(()); // Return early without error
|
||||
}
|
||||
|
||||
// Execute migrations in transaction if supported
|
||||
migrator.run(pool)
|
||||
.await
|
||||
.map_err(DatabaseError::MigrationError)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
# Handlers Module for Rust API
|
||||
|
||||
This folder contains the route handlers used in the Rust API, responsible for processing incoming HTTP requests and generating responses.
|
||||
# Handlers
|
||||
This folder contains the route handlers used in Axium, responsible for processing incoming HTTP requests and generating responses.
|
||||
|
||||
## Overview
|
||||
The `/src/handlers` folder includes implementations of route handlers for API keys, usage metrics, and the homepage.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user