Application Configuration
The Dev Showcase application is configured inProgram.cs using ASP.NET Core’s minimal hosting model.
Service Registration
AddControllersWithViews
- Controller activation and model binding
- View rendering engine (Razor)
- JSON formatters for API responses
- Default MVC conventions and filters
Middleware Pipeline
The middleware pipeline is configured in the following order:1. Exception Handling (Production Only)
Environment-specific behavior. In non-development environments:
- Unhandled exceptions redirect to
/Home/Error - HSTS (HTTP Strict Transport Security) is enabled
2. HTTPS Redirection
3. Routing
4. Authorization
5. Static Assets
Route Configuration
The application defines several route patterns:Root Redirect
/) to the default profile (/dataScience).
Language-Only Redirect
Language code constrained by regex to
es (Spanish) or en (English).
Redirects to /{lang}/dataScience.Profile with Language Route
Language code:
es or enProfile identifier:
dataScience, webDev, dataAnalyst, or DataAnalysisHomeController.Profile(string profile)
Profile without Language Route
Profile identifier:
dataScience, webDev, dataAnalyst, or DataAnalysisHomeController.Profile(string profile)
Default MVC Route
- Default controller:
Home - Default action:
HomePage - Optional
idparameter - Static assets support enabled
Environment-Specific Behavior
Development
- Detailed exception pages are shown
- No HSTS enforcement
- Developer-friendly error messages
Production
- Custom error page at
/Home/Error - HSTS enabled for secure connections
- Generic error messages to prevent information disclosure