Ejemplo n.º 1
0
        public static void Register()
        {
            // Use this class to set configuration options for your mobile service
            ConfigOptions options = new ConfigOptions();

            SignalRExtensionConfig.Initialize();

            // Use this class to set WebAPI configuration options
            HttpConfiguration config = ServiceConfig.Initialize(new ConfigBuilder(options));



            // To display errors in the browser during development, uncomment the following
            // line. Comment it out again when you deploy your service for production use.
            // config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
        }
        public static void Register()
        {
            // Use this class to set configuration options for your mobile service
            ConfigOptions options = new ConfigOptions();

            options.PushAuthorization = Microsoft.WindowsAzure.Mobile.Service.Security.AuthorizationLevel.User;

            var configBuilder = new ConfigBuilder(options, (httpconfig, ioc) =>
            {
                ioc.RegisterInstance(new CORSSignalROwinAppBuilderExtension(httpconfig)).As <IOwinAppBuilderExtension>();
            });

            //Config Setting for Accessible Web Client
            //options.CorsPolicy = new System.Web.Http.Cors.EnableCorsAttribute("http://strandd.azurewebsites.net, http://strandd-dev.azurewebsites.net", "*", "*");
            //config.EnableCors(options.CorsPolicy);

            // Use this class to set WebAPI configuration options
            HttpConfiguration config = ServiceConfig.Initialize(configBuilder);

            // To display errors in the browser during development, uncomment the following
            // line. Comment it out again when you deploy your service for production use.
            config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

            //config.MapHttpAttributeRoutes();

            // Initialize SignalR
            //var idProvider = new ZumoIUserProvider();
            //GlobalHost.DependencyResolver.Register(typeof(IUserIdProvider), () => idProvider );
            SignalRExtensionConfig.Initialize();


            //EF DB-Migrator
            var migrator = new DbMigrator(new Configuration());

            migrator.Update();


            //This is for full Scema Drop DB Init [unused]
            //Database.SetInitializer(new stranddInitializer());

            //This tells the local mobile service project to run as if it is being hosted in Azure, including honoring the AuthorizeLevel settings.
            config.SetIsHosted(true);
        }
Ejemplo n.º 3
0
        public static void Register()
        {
            // Use this class to set configuration options for your mobile service
            ConfigOptions options = new ConfigOptions();

            // Use this class to set WebAPI configuration options
            HttpConfiguration config = ServiceConfig.Initialize(new ConfigBuilder(options));

            // To display errors in the browser during development, uncomment the following
            // line. Comment it out again when you deploy your service for production use.
            // config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

            // Set default and null value handling to "Include" for Json Serializer
            config.Formatters.JsonFormatter.SerializerSettings.DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Include;
            config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling    = Newtonsoft.Json.NullValueHandling.Include;

            Database.SetInitializer(new demosignalrInitializer());

            SignalRExtensionConfig.Initialize();
        }