From ea547167748a1ec99fe98fa83ab053844db7f831 Mon Sep 17 00:00:00 2001 From: Vrganj Date: Sat, 16 Jan 2021 18:52:18 +0100 Subject: [PATCH] Fix order of args and stdin --- api/src/index.js | 2 +- shared/execute.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/index.js b/api/src/index.js index 70878ea..d628ba1 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -56,7 +56,7 @@ app.post( language.aliases.includes(req.body.language.toLowerCase()) ); - const { stdout, stderr, output, ran } = await execute(language, req.body.source, req.body.args, req.body.stdin); + const { stdout, stderr, output, ran } = await execute(language, req.body.source, req.body.stdin, req.body.args); res.status(200).json({ ran, diff --git a/shared/execute.js b/shared/execute.js index fbfd5de..4124928 100644 --- a/shared/execute.js +++ b/shared/execute.js @@ -1,7 +1,7 @@ const { writeFile } = require('fs/promises'); const { spawn } = require('child_process'); -function execute(language, source, args, stdin) { +function execute(language, source, stdin, args) { return new Promise(async resolve => { const stamp = new Date().getTime(); const sourceFile = `/tmp/${stamp}.code`;