Exemple #1
0
 static SkimurContext()
 {
     LicenseUtils.RegisterLicense("2283-e1JlZjoyMjgzLE5hbWU6TWVkWENoYW5nZSxUeXBlOkluZGllLEhhc2g6TU" +
                                  "FyaTVzNGdQcEdlc0pqd1ZIUXVlL0lacDBZcCt3TkFLY0UyMTlJblBuMzRLNWFRb" +
                                  "HBYN204aGkrQXlRYzUvZnNVUlZzWXd4NjR0OFlXZEpjNUNYRTdnMjBLR0ZjQmhG" +
                                  "dTFNMHZVazJqcHdQb1RrbStDaHNPRm11Qm50TnZzOTkwcHAzRkxtTC9idThMekN" +
                                  "lTVRndFBORzBuREZ0WGJUdzdRMi80K09lQ2tZPSxFeHBpcnk6MjAxNi0wMi0xOX" +
                                  "0=");
 }
Exemple #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILifetimeScope lifetimeScope, IApplicationLifetime applicationLifetime)
        {
            LicenseUtils.RegisterLicense(Configuration["servicestack:license"]);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
                {
                    HotModuleReplacement = true,
                    ConfigFile           = "webpack.netcore.config.js",
                    HotModuleReplacementClientOptions = new Dictionary <string, string> {
                        { "reload", "true" }
                    }
                });
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseForwardedHeaders(new ForwardedHeadersOptions
                {
                    ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
                });
            }

            app.UseStaticFiles();

            app.UseSignalR(routes =>
            {
                routes.MapHub <SongHub>("song");
            });

            app.UseServiceStack(lifetimeScope.Resolve <AppHostBase>());

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");

                routes.MapSpaFallbackRoute(
                    name: "spa-fallback",
                    defaults: new { controller = "Home", action = "Index" });
            });

            CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();

            lifetimeScope.Resolve <IWebcaster>().Start(8003, cancellationTokenSource.Token);

            applicationLifetime.ApplicationStopping.Register(() =>
            {
                cancellationTokenSource.Cancel();
            });
        }
Exemple #3
0
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(env.ContentRootPath)
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                          .AddEnvironmentVariables();

            Configuration = builder.Build();

            LicenseUtils.RegisterLicense(Configuration["servicestack:license"]);
        }
Exemple #4
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            LicenseUtils.RegisterLicense(Configuration["servicestack:license"]);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseServiceStack(new AppHost
            {
                AppSettings = new NetCoreAppSettings(Configuration)
            });
        }
        /// <summary>
        /// Default constructor.
        /// Base constructor requires a Name and assembly to locate web service classes.
        /// </summary>
        public AppHost()
            : base("CIWizard", typeof(MyServices).Assembly)
        {
            var customSettings = new FileInfo(@"~/appsettings.txt".MapHostAbsolutePath());

            AppSettings = customSettings.Exists
                ? (IAppSettings) new TextFileSettings(customSettings.FullName)
                : new AppSettings();

            if (AppSettings.Exists("ServiceStackLicense"))
            {
                LicenseUtils.RegisterLicense(AppSettings.GetString("ServiceStackLicense"));
            }
        }
        public SqlConnectionProvider(IConnectionStringProvider connectionStringProvider)
        {
            _connectionStringProvider = connectionStringProvider;
            LicenseUtils.RegisterLicense("2283-e1JlZjoyMjgzLE5hbWU6TWVkWENoYW5nZSxUeXBlOkluZGllLEhhc2g6TU" +
                                         "FyaTVzNGdQcEdlc0pqd1ZIUXVlL0lacDBZcCt3TkFLY0UyMTlJblBuMzRLNWFRb" +
                                         "HBYN204aGkrQXlRYzUvZnNVUlZzWXd4NjR0OFlXZEpjNUNYRTdnMjBLR0ZjQmhG" +
                                         "dTFNMHZVazJqcHdQb1RrbStDaHNPRm11Qm50TnZzOTkwcHAzRkxtTC9idThMekN" +
                                         "lTVRndFBORzBuREZ0WGJUdzdRMi80K09lQ2tZPSxFeHBpcnk6MjAxNi0wMi0xOX" +
                                         "0=");

            OrmLiteConfig.DialectProvider = PostgreSqlDialect.Provider;
            //OrmLiteConfig.DialectProvider.NamingStrategy = new NamingStrategy();
            _factory = Npgsql.NpgsqlFactory.Instance;
        }
Exemple #7
0
        public Startup(IHostingEnvironment env)
        {
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(env.ContentRootPath)
                                            .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                                            .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);

            if (env.IsDevelopment())
            {
                // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
                //builder.AddUserSecrets();
            }

            builder.AddEnvironmentVariables();

            Configuration = builder.Build();

            LicenseUtils.RegisterLicense(Configuration["servicestack:license"]);
        }