node.js - Is there a way to run a .net exe on heroku? -
i've wondered if there way run .net executable file in heroku.i know heroku linux based there way?
here test code works on computer (windows). exe file writes in "writetext.txt" , read it.
var http = require("http"); var express = require("express"); var app = express(); var port = process.env.port || 1234; var exec = require('child_process').execfile; var fs = require('fs'); app.use(express.static(__dirname + "/")) var server = http.createserver(app) server.listen(port); app.get('/exec', function(req, res){ exec('test.exe', function(err, data) { console.log(err) console.log(data.tostring() + "data"); }); fs.readfile(__dirname + '/writetext.txt', 'utf8', function (err,data) { if (err) { return console.log(err); } console.log(data); res.end(data.tostring()); }); }); app.get('/*', function(req, res){ res.send("hello word!"); res.end(); }); console.log("http server listening on %d", port)
there way run .net code on linux (or macos). want use mono (http://www.mono-project.com/). mono open source implementation of clr among other portions of .net. after installing mono, instead of running test.exe run mono test.exe parameter. straightforward. install mono platform , try running test executable command line 'mono ./test.exe
' start. if looks can update node app run mono or create script same thing.
Comments
Post a Comment