diff --git a/.template.config/template.json b/.template.config/template.json
index 02177c88d..1ee62509b 100644
--- a/.template.config/template.json
+++ b/.template.config/template.json
@@ -18,8 +18,17 @@
},
"sourceName": "CleanArchitecture",
"preferNameDirectory": true,
+ "symbols":{
+ "apiOnly":{ "type": "parameter", "dataType":"bool", "defaultValue": "false" }
+ },
"sources": [
{
+ "modifiers": [
+ {
+ "condition": "(apiOnly)",
+ "exclude": ["src/WebUI/ClientApp/**/*"]
+ }
+ ],
"source": "./",
"target": "./",
"exclude": [
diff --git a/src/WebUI/Properties/launchSettings.json b/src/WebUI/Properties/launchSettings.json
index 9dcdb5c5f..9ba871594 100644
--- a/src/WebUI/Properties/launchSettings.json
+++ b/src/WebUI/Properties/launchSettings.json
@@ -11,10 +11,15 @@
"CleanArchitecture.WebUI": {
"commandName": "Project",
"launchBrowser": true,
+ //#if(apiOnly)
+ "launchUrl": "https://localhost:5001/api",
+ //#endif
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
+ //#if(!apiOnly)
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
+ //#endif
}
},
"IIS Express": {
@@ -22,7 +27,9 @@
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
+ //#if(!apiOnly)
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
+ //#endif
}
}
}
diff --git a/src/WebUI/WebUI.csproj b/src/WebUI/WebUI.csproj
index fe330404e..aca8452d7 100644
--- a/src/WebUI/WebUI.csproj
+++ b/src/WebUI/WebUI.csproj
@@ -4,9 +4,11 @@
net7.0
enable
true
+
ClientApp\
https://localhost:44447
npm start
+
enable
true
@@ -25,9 +27,11 @@
+
-
+
+
all
@@ -42,51 +46,55 @@
+
+
+ OnBuildSuccess
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
- OnBuildSuccess
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- wwwroot\%(RecursiveDir)%(FileName)%(Extension)
- PreserveNewest
- true
-
-
-
+
+
+
+
+ wwwroot\%(RecursiveDir)%(FileName)%(Extension)
+ PreserveNewest
+ true
+
+
+
+
diff --git a/src/WebUI/nswag.json b/src/WebUI/nswag.json
index bd92a82bd..3df3a0e4a 100644
--- a/src/WebUI/nswag.json
+++ b/src/WebUI/nswag.json
@@ -59,8 +59,9 @@
"referencePaths": [],
"useNuGetCache": false
}
- },
- "codeGenerators": {
+ }
+ //#if(!apiOnly)
+ ,"codeGenerators": {
"openApiToTypeScriptClient": {
"className": "{controller}Client",
"moduleName": "",
@@ -124,4 +125,5 @@
"newLineBehavior": "Auto"
}
}
-}
+ //#endif
+}
\ No newline at end of file