A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Azure-Samples/azure-functions-nodejs-stream below:

Azure-Samples/azure-functions-nodejs-stream: Sample app to demonstrate HTTP streams on Azure Functions.

Azure Functions Node.js Stream Sample

The app in this repo demonstrates the new Node.js HTTP streams feature on Azure Functions. It streams a large file (96mb by default) named temp/input.txt to a file temp/output.txt and logs the progress. This app has http streams turned on by default, but you can change this (and other settings) by modifying the src/constants.ts file.

  1. Add a local.settings.json file with the following contents:

    {
        "IsEncrypted": false,
        "Values": {
            "AzureWebJobsStorage": "",
            "FUNCTIONS_WORKER_RUNTIME": "node",
            "FUNCTIONS_REQUEST_BODY_SIZE_LIMIT": "4294967296"
        }
    }
  2. Run npm install.

  3. Run npm start. This will build the app, create the large input file, and start the app.

  4. Leave the previous terminal running and open a new terminal to execute a function.

  5. You should see progress in the console as the file is processed. It happens fast for a 96mb file, but as long as you see a chunk count greater than 1, you know your data was streamed.

We recommend you play around with this app to really get a feel for the feature!

  1. Follow the steps above to run your app.
  2. Open a new terminal and run npm watch. This will ensure your running app is updated every time you save a file.
  3. Modify a setting in src/constants.ts, run the scripts mentioned above to simulate streaming a request or response, and see what happens!

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4