File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
HueEntertainmentPro/Server Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 1+ using HueLightDJ . Services ; // ✅ KORREKT - Nicht . Internal
2+ using Microsoft . AspNetCore . Mvc ;
3+
4+ namespace HueEntertainmentPro . Server . Controllers
5+ {
6+ [ Route ( "api" ) ]
7+ [ ApiController ]
8+ public class ApiController : ControllerBase
9+ {
10+ private readonly EffectService _effectService ;
11+
12+ public ApiController ( EffectService effectService )
13+ {
14+ _effectService = effectService ;
15+ }
16+
17+ /// <summary>
18+ /// Triggers a beat effect with the specified intensity
19+ /// </summary>
20+ /// <param name="intensity">Beat intensity (typically 0.0 to 1.0)</param>
21+ [ HttpPost ( "beat" ) ]
22+ public IActionResult Beat ( [ FromBody ] double intensity )
23+ {
24+ try
25+ {
26+ _effectService . Beat ( intensity ) ;
27+ return Ok ( new { success = true , message = "Beat triggered successfully" } ) ;
28+ }
29+ catch ( System . Exception ex )
30+ {
31+ return StatusCode ( 500 , new { success = false , error = ex . Message } ) ;
32+ }
33+ }
34+
35+ /// <summary>
36+ /// Test endpoint to verify API is working
37+ /// </summary>
38+ [ HttpGet ( "test" ) ]
39+ public IActionResult Test ( )
40+ {
41+ return Ok ( new { status = "API is working" , timestamp = System . DateTime . UtcNow } ) ;
42+ }
43+ }
44+ }
Original file line number Diff line number Diff line change 2626builder . Services . AddFluentUIComponents ( ) ;
2727builder . Services . AddSignalR ( ) ;
2828
29+ builder . Services . AddControllers ( ) ;
30+
2931builder . Services . AddGrpc ( ) ;
3032builder . Services . AddResponseCompression ( opts =>
3133{
7072 app . UseHsts ( ) ;
7173}
7274
73- // app.UseHttpsRedirection();
75+ app . UseHttpsRedirection ( ) ;
7476
7577app . UseBlazorFrameworkFiles ( ) ;
7678app . UseStaticFiles ( ) ;
7779
80+
7881//Reverse Proxy to Hue Bridge, disabled in DEMO mode
7982if ( app . Environment . EnvironmentName != "DEMO" )
8083{
You can’t perform that action at this time.
0 commit comments