feat(dotnet): added in wrapper so we could run in iis for ssl :D

This commit is contained in:
2025-06-16 18:27:42 -05:00
parent c72b4d3261
commit 84aacd5b71
10 changed files with 137 additions and 8 deletions

4
.gitignore vendored
View File

@@ -11,6 +11,10 @@ backend-0.1.2-218.zip
backend-0.1.2.zip backend-0.1.2.zip
postgresql-17.2-3-windows-x64.exe postgresql-17.2-3-windows-x64.exe
jsTesting jsTesting
dotnetwrapper/bin
dotnetwrapper/obj
dotnetwrapper/wwwroot
prodBuild
# ---> Node # ---> Node

26
dotnetwrapper/Program.cs Normal file
View File

@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
// if (!app.Environment.IsDevelopment())
// {
// // app.UseExceptionHandler("/Home/Error");
// // app.UseHsts();
// }
// app.UseHttpsRedirection(); // to force https
app.UseStaticFiles();
app.UseRouting();
app.MapFallbackToFile("index.html");
app.Run();

View File

@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:3000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:3000;http://localhost:3000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

View File

@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<Target Name="CopyToProjectWwwRoot" AfterTargets="BuildViteApp">
<ItemGroup>
<ViteDistFiles Include="..\my-vite-app\dist\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(ViteDistFiles)" DestinationFolder="wwwroot\%(RecursiveDir)" />
</Target>
<!-- <Target Name="CopyViteFiles" AfterTargets="Build">
<ItemGroup>
<ViteDistFiles Include="..\my-vite-app\dist\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(ViteDistFiles)" DestinationFolder="$(OutDir)wwwroot\%(RecursiveDir)" SkipUnchangedFiles="true" />
</Target> -->
<!-- <ItemGroup>
<Content Include="..\my-vite-app\dist\**" LinkBase="wwwroot" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup> -->
</Project>

View File

@@ -0,0 +1,24 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lst-wrapper", "lst-wrapper.csproj", "{073770C2-0E50-484C-BB72-0A7B602D10B7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{073770C2-0E50-484C-BB72-0A7B602D10B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{073770C2-0E50-484C-BB72-0A7B602D10B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{073770C2-0E50-484C-BB72-0A7B602D10B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{073770C2-0E50-484C-BB72-0A7B602D10B7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {39D31A4B-FECC-425A-9AD5-95EF563F5BE7}
EndGlobalSection
EndGlobal

View File

@@ -1,5 +1,10 @@
import { Link } from "@tanstack/react-router"; import { Link } from "@tanstack/react-router";
import {SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem} from "../../ui/sidebar"; import {
SidebarHeader,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "../../ui/sidebar";
export function Header() { export function Header() {
return ( return (
@@ -9,10 +14,16 @@ export function Header() {
<Link to="/"> <Link to="/">
<SidebarMenuButton size="lg" asChild> <SidebarMenuButton size="lg" asChild>
<div className="flex flex-row"> <div className="flex flex-row">
<img src="/imgs/dkLst.png" alt="Description" className="size-8" /> <img
src={"imgs/dkLst.png"}
alt="Description"
className="size-8"
/>
<div className="flex flex-col gap-0.5 leading-none"> <div className="flex flex-col gap-0.5 leading-none">
<span className="font-semibold">Logistics Support Tool</span> <span className="font-semibold">
Logistics Support Tool
</span>
<span className="">v2.0.0</span> <span className="">v2.0.0</span>
</div> </div>
</div> </div>

View File

@@ -10,7 +10,10 @@ import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
// Create a client // Create a client
const queryClient = new QueryClient(); const queryClient = new QueryClient();
// Create a new router instance // Create a new router instance
const router = createRouter({routeTree}); const router = createRouter({
routeTree,
//basepath: import.meta.env.BASE_URL, // This is the key part!
});
// Register the router instance for type safety // Register the router instance for type safety
declare module "@tanstack/react-router" { declare module "@tanstack/react-router" {

View File

@@ -17,6 +17,7 @@ export default defineConfig({
tailwindcss(), tailwindcss(),
TanStackRouterVite({ target: "react", autoCodeSplitting: true }), TanStackRouterVite({ target: "react", autoCodeSplitting: true }),
], ],
// base: "/lst", // this is whats showing in the ssl version and we need this to work on both versions that also have a port on them.
resolve: { resolve: {
alias: { alias: {
"@": path.resolve(__dirname, "./src"), "@": path.resolve(__dirname, "./src"),

View File

@@ -37,6 +37,7 @@ const ignoreList = [
"frontend/components.json", "frontend/components.json",
//misc files //misc files
"jsTesting", "jsTesting",
"dotnetwrapper",
]; ];
const shouldIgnore = (itemPath: any) => { const shouldIgnore = (itemPath: any) => {