Exemple #1
0
 /// <summary>
 /// Adds the Swagger UI to the RESTful application.
 /// </summary>
 /// <param name="config">The OWIN config.</param>
 private static void AddSwaggerSupport(HttpConfiguration config)
 {
     config.EnableSwagger(c =>
     {
         var settingsProvider = IoCProvider.Resolve <ISettingsProvider>();
         c.SingleApiVersion("v1", settingsProvider.Title)
         .Description(settingsProvider.Description);
         c.IncludeXmlComments($@"{System.AppDomain.CurrentDomain.BaseDirectory}\Api.xml");
     }).EnableSwaggerUi();
 }
Exemple #2
0
        /// <summary>
        /// Maps all the routes in the application.
        /// </summary>
        /// <param name="config">The OWIN config.</param>
        private static void MapRoutes(HttpConfiguration config)
        {
            var settingsProvider = IoCProvider.Resolve <ISettingsProvider>();

            config.MapHttpAttributeRoutes();
            config.Routes.MapHttpRoute(
                name: "swagger",
                routeTemplate: "",
                defaults: null,
                constraints: null,
                handler: new RedirectHandler(message => settingsProvider.Address, "swagger"));
        }
Exemple #3
0
 private void InitializeIoC()
 {
     IoCProvider.Initialize();
 }