Skip to content

Instantly share code, notes, and snippets.

@stafordtituss
stafordtituss / main.js
Created Mar 4, 2020
HTTP Readable Stream using fetch - SERVER SIDE (NodeJS) < An example for getting artillery report stream >
View main.js
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
const {exec} = require('child_process');
var data1;
var FetchStream = require("fetch").FetchStream;
const { spawn } = require("child_process");
app.use(express.static('public'));
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine','ejs')
@stafordtituss
stafordtituss / artillery.ejs
Created Mar 4, 2020
HTTP Readable Stream using fetch - CLIENT SIDE (HTML and Vanilla JS) < An example for getting artillery report stream >
View artillery.ejs
<!DOCTYPE html>
<html>
<head>
<title>Artillery Report Generation</title>
</head>
<body>
<h1>ARTILLERY REPORT GENERATION</h1>
<p>Click the button to run the test and generate the report!!</p>
<button>RUN</button>