public Load ( string path, |
||
path | string | |
cancellationToken | ||
Résultat | Task |
async Task Invoke(IOwinContext context) { if (_state == null) { _state = new State(GetBaseAddress(context)); await _state.Load(@"c:\data\test\nuspecs", CancellationToken.None); } try { switch (context.Request.Path.Value) { case "/": context.Response.StatusCode = (int)HttpStatusCode.OK; await context.Response.WriteAsync("READY"); break; case "/debug": await Debug(context); break; // basically case "/v3/query": await ServiceEndpoints.V3SearchAsync(context, _state.SearcherManager); break; case "/v3/autocomplete": await ServiceEndpoints.AutoCompleteAsync(context, _state.SearcherManager); break; default: await Lookup(context); break; } } catch (Exception e) { throw e; } }
async Task Invoke(IOwinContext context) { if (_state == null) { _state = new State(GetBaseAddress(context)); await _state.Load(@"c:\data\test\nuspecs", CancellationToken.None); } try { switch (context.Request.Path.Value) { case "/": context.Response.StatusCode = (int)HttpStatusCode.OK; await context.Response.WriteAsync("READY"); break; case "/debug": await Debug(context); break; // basically case "/v3/query": await ServiceEndpoints.V3SearchAsync(context, _state.SearcherManager); break; case "/v3/autocomplete": await ServiceEndpoints.AutoCompleteAsync(context, _state.SearcherManager); break; default: await Lookup(context); break; } } catch (Exception e) { throw e; } }