Skip to content

Need for proxy? #5

@goofballLogic

Description

@goofballLogic

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));

            }
            . . .            

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions