File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ using Gommon ;
2+ using Microsoft . AspNetCore . Mvc ;
3+ using Ryujinx . Systems . Update . Server . Helpers ;
4+
5+ namespace Ryujinx . Systems . Update . Server . Controllers ;
6+
7+ [ Route ( "/" ) ]
8+ [ ApiController ]
9+ public class InfoController : ControllerBase
10+ {
11+ [ HttpGet ]
12+ [ ApiExplorerSettings ( IgnoreApi = true ) ]
13+ public ActionResult Index ( )
14+ => Redirect ( "https://github.com/Ryubing/UpdateServer/" ) ;
15+
16+ [ HttpGet ( "docs" ) , HttpGet ( "info" ) , HttpGet ( "help" ) ]
17+ [ EndpointDescription ( "Redirects the requestor to the /swagger endpoint." ) ]
18+ public ActionResult Help ( )
19+ {
20+ return CommandLineState . Swagger
21+ ? Redirect ( "/swagger" )
22+ : Index ( ) ;
23+ }
24+
25+ public static readonly string ServerVersion = typeof ( Program ) . Assembly . GetName ( ) . Version ! . ToString ( ) [ ..^ 2 ] ;
26+ public const string ReleaseUrlFormat = "https://github.com/Ryubing/UpdateServer/releases/tag/{0}" ;
27+
28+ [ HttpGet ( "version" ) ]
29+ [ EndpointDescription ( "Redirects to or shows the requestor the current UpdateServer GitHub release URL." ) ]
30+ public ActionResult Version ( [ FromQuery ] bool redirect = true )
31+ {
32+ return redirect
33+ ? Redirect ( ReleaseUrlFormat . Format ( ServerVersion ) )
34+ : Ok ( ReleaseUrlFormat . Format ( ServerVersion ) ) ;
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments