A few typos fixed, fixed a bug with the migrator.

This commit is contained in:
Rik Heijmann 2025-02-15 21:12:17 +01:00
parent 6258587d01
commit 96f8e9b534
4 changed files with 10 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -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.

View File

@ -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(())
}
}

View File

@ -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.