Git Product home page Git Product logo

Comments (1)

rafiqcse avatar rafiqcse commented on September 4, 2024 1

At last I succeed to deploy the project to IIS following below instruction

  1. Install .net hosting bundle, urlrewrite2, httpPlatformHandler_amd64.msi, WebPlatformInstaller_x64_en-US.msi

  2. hosts file location C:\Windows\System32\drivers\etc
    -127.0.0.1 nucleus.com

  3. Adding a website for Vuejs client project to iis
    –In this case hosts file name nucleus.com should same host name in iis.

  4. Adding a web application under client to iis as named api

  5. Please go to binding section after selecting client website in iis
    -Adding another binding whose type https and port 44323 (port may change)

  6. Please select api in IIS and double click to SSLSettings
    -Select Require SSL and Accept then apply changes.

  7. Please add named β€œapi” as per server name in IIS to the url in appsettings.Production.json, launchSettings.json, .env.Production, appSettings.json

  8. Please change startup class in server project as follows

    private readonly IConfiguration _configuration;
    public Startup(IConfiguration configuration)
    {
        _configuration = configuration;
    }
    public void ConfigureServices(IServiceCollection services)
    {
        services.ConfigureDbContext(_configuration);
        services.ConfigureAuthentication();
        services.ConfigureJwtTokenAuth(_configuration);
        services.ConfigureCors(_configuration);
        services.ConfigureDependencyInjection();
        services.ConfigureNucleusApplication();
        services.ConfigureSmtp(_configuration);
    
        services.AddControllers(setup =>
        {
            setup.Filters.AddService<UnitOfWorkActionFilter>();
        }).AddNewtonsoftJson();
    
        services.AddSwaggerGen(options =>
        {
            options.SwaggerDoc("v1", new OpenApiInfo { Title = "Nucleus API", Version = "v1" });
            options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
            {
                Description = "Standard Authorization header using the Bearer scheme. Example: \"bearer {token}\"",
                In = ParameterLocation.Header,
                Name = "Authorization",
                Type = SecuritySchemeType.ApiKey
            });
    
            options.OperationFilter<SecurityRequirementsOperationFilter>();
        });
        services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
    }
    
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment() || env.IsProduction())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseHsts();
        }
        app.UseSwagger();
        app.UseSwaggerUI(c =>
        {
            c.SwaggerEndpoint("/swagger/v1/swagger.json", "Nucleus API V1");
        });
    
        app.UseCors(_configuration["App:CorsOriginPolicyName"]);
        app.UseHttpsRedirection();
        app.UseRouting();
        app.UseAuthentication();
        app.UseAuthorization();
        app.UseEndpoints(endpoints =>
        {
            endpoints.MapControllers();
        });
    }
    

from nucleus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.