Created
April 3, 2020 14:01
-
-
Save siu-issiki/2fd9fb262585eb90cf6f9a717ba6dee5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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