Skip to content
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

Need for proxy? #5

Open
goofballLogic opened this issue Sep 27, 2018 · 1 comment
Open

Need for proxy? #5

goofballLogic opened this issue Sep 27, 2018 · 1 comment

Comments

@goofballLogic
Copy link

Thanks for this code which I have purloined for my own needs.

However, I also ran into the problem of requiring Azure to run the code (can't work how to run a proxy using the local tooling). I think this is similar to #4

However, once I thought about it I realized that I could just use a wildcard route for the function which worked just as well. Why do we need the proxy?

        [FunctionName("Client")]
        public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "client/{*route}")]HttpRequest req, ILogger log, string route)
        {

            try
            {
                log.LogInformation(route);
                var filePath = GetFilePath(route);

                var stream = new FileStream(filePath, FileMode.Open);
                return new FileStreamResult(stream, GetMimeType(filePath));

            }
            . . .            
@anthonychu
Copy link
Owner

I haven't tested this with Azure Functions V2, which is now generally available. You may still need a proxy if you want to serve content at the root /.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants