-
-
Save theoutlander/3999472 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment