Skip to content

Instantly share code, notes, and snippets.

@nikhilk
Created September 29, 2012 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nikhilk/3804912 to your computer and use it in GitHub Desktop.
Save nikhilk/3804912 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);
@nikhilk
Copy link
Author

nikhilk commented Sep 29, 2012

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#)

@theoutlander
Copy link

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