Skip to content

Commit

Permalink
Add hostName readme generation
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-chigrinov committed Jun 17, 2024
1 parent ed4d80e commit cfe10d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ bld/
msbuild.log
msbuild.err
msbuild.wrn
/PasadenaPromo.Server/wwwroot/index.html
4 changes: 3 additions & 1 deletion PasadenaPromo.Server/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text;
using System.Text.RegularExpressions;
using Markdig;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.EntityFrameworkCore;
Expand All @@ -12,6 +13,8 @@
var html = Markdown.ToHtml(markdown);
var linkStyles = """<link href="style.css" rel="stylesheet" />""";
html += linkStyles;
var hostName = builder.Configuration["URLS"].Split(';')[0];

Check warning on line 16 in PasadenaPromo.Server/Program.cs

View workflow job for this annotation

GitHub Actions / deploy

Dereference of a possibly null reference.
html = Regex.Replace(html, "{{.+}}", hostName);
var index = "./wwwroot/index.html";
var file = new FileStream(index, FileMode.Create);
file.Close();
Expand Down Expand Up @@ -90,5 +93,4 @@

app.UseHttpsRedirection();
app.MapControllers();

app.Run();

0 comments on commit cfe10d6

Please sign in to comment.