summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Web/Controllers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 20:33:09 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-09-22 20:33:09 -0400
commite4a2f555170b08263ae2d7e713808bd229b48947 (patch)
treeec59e1c0063d2b5d3f28debd41962eb015b91ee7 /src/StardewModdingAPI.Web/Controllers
parent2406d4b0a6fd8b2d439438687b0101a6f8934ca5 (diff)
downloadSMAPI-e4a2f555170b08263ae2d7e713808bd229b48947.tar.gz
SMAPI-e4a2f555170b08263ae2d7e713808bd229b48947.tar.bz2
SMAPI-e4a2f555170b08263ae2d7e713808bd229b48947.zip
add GET endpoint for testing (#336)
Diffstat (limited to 'src/StardewModdingAPI.Web/Controllers')
-rw-r--r--src/StardewModdingAPI.Web/Controllers/ModsController.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Web/Controllers/ModsController.cs b/src/StardewModdingAPI.Web/Controllers/ModsController.cs
index 7f7afbb9..366201e3 100644
--- a/src/StardewModdingAPI.Web/Controllers/ModsController.cs
+++ b/src/StardewModdingAPI.Web/Controllers/ModsController.cs
@@ -29,6 +29,17 @@ namespace StardewModdingAPI.Web.Controllers
** Public methods
*********/
/// <summary>Fetch version metadata for the given mods.</summary>
+ /// <param name="modKeys">The namespaced mod keys to search as a comma-delimited array.</param>
+ [HttpGet]
+ public async Task<IDictionary<string, ModInfoModel>> GetAsync(string modKeys)
+ {
+ return await this.Post(new ModSearchModel
+ {
+ ModKeys = modKeys?.Split(',').Select(p => p.Trim()).ToArray() ?? new string[0]
+ });
+ }
+
+ /// <summary>Fetch version metadata for the given mods.</summary>
/// <param name="search">The search options.</param>
[HttpPost]
public async Task<IDictionary<string, ModInfoModel>> Post([FromBody] ModSearchModel search)