Skip to content

Commit

Permalink
closes #286, adds client-specific data pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
cohoe committed Jul 9, 2024
1 parent 15a6a32 commit 661333d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/swiftarr/Resources/Assets/public/clients/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Swiftarr Client Config
======================

Sometimes it can be useful for client applications to have seed data provided by the server. At this time, Tricordarr is the only app looking to implement this feature.

The convention is to put a JSON file in this directory matching the client name in `SwiftarrClientApp` defined in `AppFeatures.swift`. The filename should be entirely lower-case. The file can contain any valid JSON. The file can then be accessed by any HTTP client at `/public/clients/${filename}.json`.

These files can be dynamically edited on the Swiftarr server and do not require version controlling. Any defaults here are provided to enhance developer testing.
14 changes: 14 additions & 0 deletions Sources/swiftarr/Resources/Assets/public/clients/tricordarr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"apiVersion": "v1",
"kind": "SwiftarrClientConfig",
"metadata": {
"name": "tricordarr"
},
"spec": {
"latestVersion": "2024.1.2",
"oobeVersion": 2,
"cruiseStartDate": "2024-03-09",
"cruiseLength": "8",
"portTimeZoneID": "America/New_York"
}
}

0 comments on commit 661333d

Please sign in to comment.