Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
readWasm endpoint updated with serilization
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammad-Mubeen committed Apr 20, 2022
1 parent 99d045d commit 83480ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"prettier": "^2.3.2",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"serialize-javascript": "^6.0.0",
"ts-node": "^10.1.0",
"ts-results": "^3.3.0",
"tslint": "^5.12.1",
Expand Down
12 changes: 9 additions & 3 deletions routes/readWasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ require("dotenv").config();
var express = require("express");
var router = express.Router();
var routerJsClient=require('../JsClients/ROUTER/src/utils')
//const v8 = require('v8');
var serialize = require('serialize-javascript');

router.route("/getWasmData").get(async function (req, res, next) {
try {

let wasmData= routerJsClient.getBinary('JsClients/ROUTER/wasm/purse-proxy.wasm');
console.log(wasmData)

console.log(wasmData);
//console.log(v8.serialize(wasmData));
console.log(serialize({ arr : wasmData}));
//JSON.parse(JSON.stringify(wasmData));
serialize({ arr : wasmData});
return res.status(200).json({
success: true,
message: "Wasm data successfully read and converted. ",
wasmData: wasmData,
// wasmData: v8.serialize(wasmData),
wasmData: serialize({ arr : wasmData}),
});

} catch (error) {
Expand Down

0 comments on commit 83480ef

Please sign in to comment.