Skip to content

Commit

Permalink
Feat: Allow PathBase to be configured (#70)
Browse files Browse the repository at this point in the history
* Allow PathBase to be configured

* update chromium version

* documentation to readme
  • Loading branch information
kallehakkanen authored Nov 18, 2021
1 parent f2dfe40 commit 3c173e7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ! IMPORTANT: Keep chromium version synced with version from package 'PuppeteerSharp'
# and match it with from https://pkgs.alpinelinux.org/packages
ARG chromium_version=93.0.4577.82-r1
ARG chromium_version=93.0.4577.82-r2

FROM mcr.microsoft.com/dotnet/core/sdk:3.1.100-alpine3.10 as dotnetBuild
ARG chromium_version
Expand Down
7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ Use local disk as storage.
}
```

## BaseUrl and PathBase configuration parameters

BaseUrl parameter needs to be set to that domain+path where this is hosted. Eg. if it is hosted at https://pdf-storage.example.com then BaseUrl needs to be set as "https://pdf-storage.example.com"

If you want to deploy this application to another than root path, eg. https://example.com/pdf-storage then PathBase needs to be set to "/pdf-storage" and BaseUrl "https://example.com/pdf-storage"


## Migrations

Tooling requires `dotnet-ef` available, so run:
Expand Down
2 changes: 2 additions & 0 deletions Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public void ConfigureServices(IServiceCollection services)

public void Configure(IApplicationBuilder app)
{
app.UsePathBase(Configuration["PathBase"]);

app.UseCors("CorsPolicy");
app.UseRouting();

Expand Down
1 change: 1 addition & 0 deletions appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}
},
"BaseUrl": "http://localhost:5000",
"PathBase": "",
"ConnectionString": "User ID=postgres;Password=passwordfortesting;Host=localhost;Port=5432;Database=pdfstorage;Pooling=true;",
"ApiAuthentication": {
"Keys": [ "apikeyfortesting" ]
Expand Down

0 comments on commit 3c173e7

Please sign in to comment.