mirror of
https://github.com/mmahdium/HoolIt.git
synced 2026-09-28 01:41:42 +03:30
Use catch-all route parameter for greater flexibility in endpoint handling.
This commit is contained in:
+2
-2
@@ -21,7 +21,7 @@ var topicSubscribers = new ConcurrentDictionary<string, ConcurrentDictionary<Gui
|
|||||||
app.MapGet("/", () => Results.Redirect("https://github.com/mmahdium/HoolIt"));
|
app.MapGet("/", () => Results.Redirect("https://github.com/mmahdium/HoolIt"));
|
||||||
|
|
||||||
var createApi = app.MapGroup("/dweet/for");
|
var createApi = app.MapGroup("/dweet/for");
|
||||||
createApi.MapGet("/{feedId}", (HttpContext context, string feedId) =>
|
createApi.MapGet("/{*feedId}", (HttpContext context, string feedId) =>
|
||||||
{
|
{
|
||||||
var dweet = new Dweet
|
var dweet = new Dweet
|
||||||
{
|
{
|
||||||
@@ -50,7 +50,7 @@ createApi.MapGet("/{feedId}", (HttpContext context, string feedId) =>
|
|||||||
|
|
||||||
// Subscribe endpoint
|
// Subscribe endpoint
|
||||||
var getLiveDataApi = app.MapGroup("/listen/for/dweets/from");
|
var getLiveDataApi = app.MapGroup("/listen/for/dweets/from");
|
||||||
getLiveDataApi.MapGet("/{feedId}", async (HttpContext context, string feedId, CancellationToken reqCancellationToken) =>
|
getLiveDataApi.MapGet("/{*feedId}", async (HttpContext context, string feedId, CancellationToken reqCancellationToken) =>
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 200;
|
context.Response.StatusCode = 200;
|
||||||
context.Response.Headers.ContentType = "text/plain; charset=utf-8";
|
context.Response.Headers.ContentType = "text/plain; charset=utf-8";
|
||||||
|
|||||||
Reference in New Issue
Block a user