Skip to content

Refactoring namespace and method naming rule #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ public class Function1 : HttpFunctionBase
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "{*path}"})] HttpRequest req,
ILogger log)
{
#if USE_PROXY
return ProxyStaticApp("https://example.com", fallbackExclude: $"^/_nuxt/.*");
#if USE_REMOTE
return RemoteStaticApp("https://example.com", fallbackExclude: $"^/_nuxt/.*");
#else
return LocalStaticApp(fallbackPath: "404.html", fallbackExclude: $"^/_nuxt/.*");
#endif
Expand Down
2 changes: 1 addition & 1 deletion samples/WebsiteSample/StaticWebsite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public IActionResult Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", "put", "delete", "options", "head", "patch", Route = "{*path}")]
HttpRequest req)
{
//return ProxyStaticApp("https://ststaticwebsiteproxy.z11.web.core.windows.net", fallbackExclude: $"^/_nuxt/.*");
//return RemoteStaticApp("https://ststaticwebsiteproxy.z11.web.core.windows.net", fallbackExclude: $"^/_nuxt/.*");

return LocalStaticApp(fallbackPath: "200.html", fallbackExclude: $"^/_nuxt/.*");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.30" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using Microsoft.Azure.WebJobs;

namespace Microsoft.Extensions.Hosting
namespace Azure.WebJobs.Extensions.HttpApi.Config
{
public static class HttpApiWebJobsBuilderExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.AspNetCore.Mvc;

namespace Azure.WebJobs.Extensions.HttpApi.Proxy
namespace Azure.WebJobs.Extensions.HttpApi.Core
{
internal class LocalStaticAppResult : IActionResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.FileProviders;

namespace Azure.WebJobs.Extensions.HttpApi.Proxy
namespace Azure.WebJobs.Extensions.HttpApi.Core
{
internal class LocalStaticAppResultExecutor : IActionResultExecutor<LocalStaticAppResult>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using Microsoft.AspNetCore.Mvc;

namespace Azure.WebJobs.Extensions.HttpApi.Proxy
namespace Azure.WebJobs.Extensions.HttpApi.Core
{
internal class ProxyResult : IActionResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;

using Azure.WebJobs.Extensions.HttpApi.Internal;

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;

namespace Azure.WebJobs.Extensions.HttpApi.Proxy
namespace Azure.WebJobs.Extensions.HttpApi.Core
{
internal class ProxyResultExecutor : IActionResultExecutor<ProxyResult>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using System.Net.Http;
using System.Text.RegularExpressions;

namespace Azure.WebJobs.Extensions.HttpApi.Proxy
namespace Azure.WebJobs.Extensions.HttpApi.Core
{
internal class ProxyStaticAppResult : ProxyResult
internal class RemoteStaticAppResult : ProxyResult
{
public ProxyStaticAppResult(string backendUri)
public RemoteStaticAppResult(string backendUri)
: base(backendUri)
{
AfterSend = AfterSendInternal;
Expand Down
5 changes: 3 additions & 2 deletions src/Azure.WebJobs.Extensions.HttpApi/HttpApiWebJobsStartup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Azure.WebJobs;
using Azure.WebJobs.Extensions.HttpApi.Config;

using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Hosting;
using Microsoft.Extensions.Hosting;

[assembly: WebJobsStartup(typeof(Azure.WebJobs.Extensions.HttpApi.HttpApiWebJobsStartup))]

Expand Down
6 changes: 3 additions & 3 deletions src/Azure.WebJobs.Extensions.HttpApi/HttpFunctionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using System.Security.Claims;
using System.Text;

using Azure.WebJobs.Extensions.HttpApi.Core;
using Azure.WebJobs.Extensions.HttpApi.Internal;
using Azure.WebJobs.Extensions.HttpApi.Proxy;

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -223,14 +223,14 @@ protected IActionResult Proxy(string backendUri, Action<HttpRequestMessage> befo
return new ProxyResult(backendUri) { BeforeSend = beforeSend, AfterSend = afterSend };
}

protected IActionResult ProxyStaticApp(string backendUri, string fallbackExclude = null)
protected IActionResult RemoteStaticApp(string backendUri, string fallbackExclude = null)
{
if (backendUri is null)
{
throw new ArgumentNullException(nameof(backendUri));
}

return new ProxyStaticAppResult(backendUri) { FallbackExclude = fallbackExclude };
return new RemoteStaticAppResult(backendUri) { FallbackExclude = fallbackExclude };
}

protected IActionResult LocalStaticApp(string defaultFile = "index.html", string fallbackPath = "404.html", string fallbackExclude = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

using Microsoft.AspNetCore.Http;

namespace Azure.WebJobs.Extensions.HttpApi.Proxy
namespace Azure.WebJobs.Extensions.HttpApi.Internal
{
internal class HttpForwarder
{
Expand Down