RESOLVED: CORS issue on ionic Mobile App ios

Problem:   I was working on a project in which I was developing an ionic application which needed to access a Website URL hosted on Azure App Service. The app was unable to connect and was throwing CORS issue. When I debugged using xcode, I found that the request is being made by the url capacitor://localhost and when I tried adding the same in Azure App Service, this was not allowed: After doing some research, I found the solution here: Solution: I used azure cli to add the cors url. For this: In case, you are not having azure cli, download it here: Run command: az login Run the following command to add url:  az webapp cors add --allowed-origins capacitor://localhost --name MyAppService --resource-group MyResourceGroup Happy Coding.

How to minify JSON in powershell?

 Recently, I had a requirement to minify json using powershell and I learnt that it is pretty simple and thought of adding it to my blog as well so that it can serve as future notes for me as well.

Here is my sample JSON

    "name": "gaurav",
    "age": "32",
    "id": 1
    "name": "sunny",
    "age": "35",
    "id": 2

Here is the powershell script:
$report = Get-Content './report.json' | Out-String
$minifiedJSON = (ConvertFrom-Json $report) | ConvertTo-Json -Compress;
Write-Host $minifiedJSON;
$minifiedJSON | Out-File -FilePath '.\minified.json'
Here is the output: