Created
September 29, 2012 19:00
-
-
Save nikhilk/3804912 to your computer and use it in GitHub Desktop.
Upcoming script# stuff... (AMD support, Node.js support, and more)
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
using System; | |
using System.Collections.Generic; | |
using NodeApi; | |
using NodeApi.Network; | |
[ScriptModule] | |
internal static class App { | |
static App() { | |
Http.CreateServer(delegate(HttpServerRequest request, HttpServerResponse response) { | |
response.WriteHead(HttpStatusCode.OK, | |
new Dictionary<string, string>("Content-Type", "text/html")); | |
response.End("Hello Node.js World, from Script#!"); | |
}).Listen(1337, "127.0.0.1"); | |
Debug.WriteLine("Server running at http://127.0.0.1:1337/"); | |
} | |
} |
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
"use strict"; | |
var ss = require('ss'), http = require('http'); | |
(function($global) { | |
http.createServer(function(request, response) { | |
response.writeHead(200, { 'Content-Type': 'text/html' }); | |
response.end('Hello Node.js World, from Script#!'); | |
}).listen(1337, '127.0.0.1'); | |
console.log('Server running at http://127.0.0.1:1337/'); | |
})(this); |
Nikhil - I just saw your comment to my question on http://stackoverflow.com/questions/10716513/how-to-use-scriptsharp-generated-js-with-nodejs and I'm excited that this feature is available!! Can't wait to try it!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Comments, feedback, and any ideas are welcome!
This is in the script# repository now... need to finalize and put together a release. Do read History.txt for all that has changed (there are a few, hopefully minor, breaking changes if you're already using script#)