Skip to content

rainxh11/QwikHosting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qwik + Deno + ASP.NET CORE

run Deno hosted Qwik app alongside ASP.NET application through YARP reverse proxy.

Version Downloads
Latest version Downloads

Example Usage:

using QwikHosting.Deno;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

builder.Services.AddReverseProxy(); // Register YARP
builder.Services.AddQwikHosting(config =>
                                {
                                    // qwik application path
                                    config.BaseDirectory = AppContext.BaseDirectory + "qwik-app";

                                    // port to run deno at, passed as 'PORT' environment variable
                                    config.Port = 9800;

                                    // if no 'deno' binary was found in path, will auto-download the latest version from github
                                    config.BinaryPick = DenoBinaryTypePriority.TryPathThenDownloaded;
                                });

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

app.UseHttpsRedirection();

app.MapGet("/api/weather", () => "weather")
   .WithName("GetWeatherForecast")
   .WithOpenApi();

app.UseQwikDenoReverseProxy(); // map qwik deno endpoints to yarp

app.Run();

Releases

No releases published

Packages

No packages published

Languages