Last active
April 26, 2019 02:37
-
-
Save marce1994/b85a6143567c0922f8923222e99207d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/marce1994/DockerAzureFunctionsDemo/blob/master/FunctionZonapropScrapping.cs | |
//... | |
[FunctionName("FunctionZonapropScrapping")] | |
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, ILogger log) | |
{ | |
int pageNumber = 0; | |
if (!int.TryParse(req.Query["pageNumber"], out pageNumber)) return new BadRequestResult(); | |
var scrapper = new ZonapropScrapper(); | |
var result = await scrapper.GetDataAsync(pageNumber); | |
return new JsonResult(result) | |
{ | |
SerializerSettings = new JsonSerializerSettings() | |
{ | |
Formatting = Formatting.Indented | |
} | |
}; | |
} | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment