Skip to content

Instantly share code, notes, and snippets.

@stafordtituss
stafordtituss / artillery.ejs
Created March 4, 2020 04:40
HTTP Readable Stream using fetch - CLIENT SIDE (HTML and Vanilla JS) < An example for getting artillery report stream >
<!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>
@stafordtituss
stafordtituss / main.js
Created March 4, 2020 04:38
HTTP Readable Stream using fetch - SERVER SIDE (NodeJS) < An example for getting artillery report stream >
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')