Skip to content

Instantly share code, notes, and snippets.

@theoutlander
Forked from nikhilk/App.cs
Created November 2, 2012 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theoutlander/3999472 to your computer and use it in GitHub Desktop.
Save theoutlander/3999472 to your computer and use it in GitHub Desktop.
Upcoming script# stuff... (AMD support, Node.js support, and more)
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/");
}
}
"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