Hi,
When we invoke sharpdata as below:
x open sharpdata -db postgres -db.connection $FMDB
Where in the SharpData source code, are the flags such as -db and -db.connection processed? I tried the source code in https://github.com/NetCoreApps/SharpData, but was not able to locate code responsible for handling these command line parameters. Can you please elaborate?
What other options can we pass to x open sharpdata
?
I am wondering if this is where the arguments are processed.
https://github.com/ServiceStack/dotnet-app/blob/0d92780ddda0034507202cb017328097ede548bf/src/Web/Startup.cs#L2585
Regards.
It’s not registered in the Sharp App, all generic info is registered in the dotnet tools, the majority of which is contained within these 2 classes (for all dotnet tools):
The app
dotnet tool has additional Chromium Desktop related features starting from its Program.cs.
You can scan the source files for anything calling GetAppSetting()
, i.e:
"bind".GetAppSetting("localhost")
"ssl".GetAppSetting(defaultValue: true)
"port".GetAppSetting(defaultValue: ssl ? "5001" : "5000")
"name".GetAppSetting(defaultValue: "WebApp")
"debug".GetAppSetting()
"icon".GetAppSettingPath(appDir)
"contentRoot".GetAppSettingPath(appDir)
"webRoot".GetAppSettingPath(appDir)
"defaultRedirect".GetAppSetting()
"appName".GetAppSetting()
"apiPath".GetAppSetting()
"db".GetAppSetting()
"db.connection".GetAppSetting()
"redis.connection".GetAppSetting()
"checkForModifiedPagesAfterSecs".GetAppSetting()
"defaultFileCacheExpirySecs".GetAppSetting()
"defaultUrlCacheExpirySecs".GetAppSetting()
"markdownProvider".GetAppSetting()
"jsMinifier".GetAppSetting()
"cssMinifier".GetAppSetting()
"htmlMinifier".GetAppSetting()
"features".GetAppSetting()
"files.config".GetAppSetting()
"files".GetAppSetting()
These different options are covered in the various example Sharp Apps, e.g:
- db settings
- redis settings
- configuring plugins
- Using a custom AppHost
- Passing Rich Config Arguments to your App
Also Desktop specific Apps like ServiceStack/Studio has additional configuration by configuring DesktopFeature in ServiceStack.Desktop, e.g:
Plugins.Add(new DesktopFeature {
// access role for Script, File & Download services
AccessRole = Config.DebugMode
? RoleNames.AllowAnon
: RoleNames.Admin,
ImportParams = { // app.settings you want auto-populated in your App
"debug",
"connect",
},
// Create a URL Scheme proxy rule for each registered site
ProxyConfigs = sites.Keys.Map(baseUrl => new Uri(baseUrl))
.Map(uri => new ProxyConfig {
Scheme = uri.Scheme,
TargetScheme = uri.Scheme,
Domain = uri.Host,
AllowCors = true,
IgnoreHeaders = { "X-Frame-Options", "Content-Security-Policy" },
})
});
Thank you very much. This is very helpful.