From 925a009f00047b3426e3afe87fc2ec1fc4c47d4d Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Wed, 20 Jan 2021 09:38:28 -0600 Subject: [PATCH] Prepare for deployment of v0.1 --- .gitignore | 36 ++++++++++++++++++++++++++- API/Controllers/FallbackController.cs | 14 +++++++++++ API/Startup.cs | 4 +++ README.md | 7 +++++- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 API/Controllers/FallbackController.cs diff --git a/.gitignore b/.gitignore index ef856c786..e226d00c7 100644 --- a/.gitignore +++ b/.gitignore @@ -448,4 +448,38 @@ appsettings.json /API/kavita.db-wal /API/Hangfire.db /API/Hangfire-log.db -cache/ \ No newline at end of file +cache/ +/API/wwwroot/assets/images/image-placeholder.jpg +/API/wwwroot/assets/images/mock-cover.jpg +/API/wwwroot/assets/images/preset-light.png +/API/wwwroot/assets/themes/plex/_bootswatch.scss +/API/wwwroot/assets/themes/plex/_variables.scss +/API/wwwroot/admin-admin-module.js +/API/wwwroot/admin-admin-module.js.map +/API/wwwroot/fa-brands-400.eot +/API/wwwroot/fa-brands-400.svg +/API/wwwroot/fa-brands-400.ttf +/API/wwwroot/fa-brands-400.woff +/API/wwwroot/fa-brands-400.woff2 +/API/wwwroot/fa-regular-400.eot +/API/wwwroot/fa-regular-400.svg +/API/wwwroot/fa-regular-400.ttf +/API/wwwroot/fa-regular-400.woff +/API/wwwroot/fa-regular-400.woff2 +/API/wwwroot/fa-solid-900.eot +/API/wwwroot/fa-solid-900.svg +/API/wwwroot/fa-solid-900.ttf +/API/wwwroot/fa-solid-900.woff +/API/wwwroot/fa-solid-900.woff2 +/API/wwwroot/favicon.ico +/API/wwwroot/index.html +/API/wwwroot/main.js +/API/wwwroot/main.js.map +/API/wwwroot/polyfills.js +/API/wwwroot/polyfills.js.map +/API/wwwroot/runtime.js +/API/wwwroot/runtime.js.map +/API/wwwroot/styles.css +/API/wwwroot/styles.css.map +/API/wwwroot/vendor.js +/API/wwwroot/vendor.js.map diff --git a/API/Controllers/FallbackController.cs b/API/Controllers/FallbackController.cs new file mode 100644 index 000000000..74ff82999 --- /dev/null +++ b/API/Controllers/FallbackController.cs @@ -0,0 +1,14 @@ +using System.IO; +using API.Services; +using Microsoft.AspNetCore.Mvc; + +namespace API.Controllers +{ + public class FallbackController : Controller + { + public ActionResult Index() + { + return PhysicalFile(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "index.html"), "text/HTML"); + } + } +} \ No newline at end of file diff --git a/API/Startup.cs b/API/Startup.cs index 90a4aff92..aaa2dae49 100644 --- a/API/Startup.cs +++ b/API/Startup.cs @@ -58,10 +58,14 @@ namespace API app.UseAuthorization(); + app.UseDefaultFiles(); + app.UseStaticFiles(); + app.UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapHangfireDashboard(); + endpoints.MapFallbackToController("Index", "Fallback"); }); } } diff --git a/README.md b/README.md index 989e151d1..78693433b 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,9 @@ open source variant that is flexible and packs more punch, without sacrificing e * Metadata should allow for collections, want to read integration from 3rd party services, genres. * Expose an OPDS API/Stream for external readers to use * Allow downloading files directly from WebApp -* WebApp/Server is Translated via Weblate (free for Open Source) \ No newline at end of file +* WebApp/Server is Translated via Weblate (free for Open Source) + + +## How to Deploy +* Build kavita-webui via ng build --prod. The dest should be placed in the API/wwwroot directory +* Run publish command \ No newline at end of file