Skip to content

Instantly share code, notes, and snippets.

@siu-issiki
Created April 3, 2020 14:01
Show Gist options
  • Save siu-issiki/2fd9fb262585eb90cf6f9a717ba6dee5 to your computer and use it in GitHub Desktop.
Save siu-issiki/2fd9fb262585eb90cf6f9a717ba6dee5 to your computer and use it in GitHub Desktop.
import express from "express"
import * as child_process from "child_process";
const app = express()
app.get('/', function (req, res) {
let proc = child_process.execFile('docker', ['run', 'hello-world'], () => {
if (error) {
console.error("stderr", stderr);
throw error;
}
console.log("pid: " +child.pid);
console.log(stdout);
res.send(stdout);
});
});
app.listen(3000, function () {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment