Last active
April 29, 2021 14:50
Revisions
-
prettymuchbryce revised this gist
May 8, 2013 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,10 @@ /// <reference path="./.node-definitions/node.d.ts" /> /** * See the node.js TypeScript definition needed for this * example here: https://github.com/borisyankov/DefinitelyTyped */ import Http = module('http'); class MyServer { -
prettymuchbryce revised this gist
May 8, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Http = module('http'); class MyServer { private header:Object = {'Content-Type': 'text/plain'}; constructor() { var server:Http.Server = Http.createServer(this.onRequest); -
prettymuchbryce revised this gist
May 8, 2013 . 1 changed file with 6 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,18 @@ /// <reference path="./.node-definitions/node.d.ts" /> import Http = module('http'); class MyServer { header:Object = {'Content-Type': 'text/plain'}; constructor() { var server:Http.Server = Http.createServer(this.onRequest); server.listen(3000); console.log("Server starting.."); } private onRequest(request:Http.ServerRequest, response:Http.ServerResponse):void { response.writeHead(200, this.header); response.end("Hello TypeScript & node.js"); } } -
prettymuchbryce revised this gist
May 8, 2013 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,16 @@ /// <reference path="./.node-definitions/node.d.ts" /> /** * See the node.js TypeScript definition needed for this * example here: https://github.com/borisyankov/DefinitelyTyped */ import Http = module('http'); import Net = module('net'); class MyServer { private header : Object = {'Content-Type': 'text/plain'}; constructor() { var server : Http.Server = Http.createServer(this.onRequest); -
prettymuchbryce created this gist
May 8, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ /// <reference path="./.node-definitions/node.d.ts" /> //See the node typescript definition referenced above, //and needed for this example here: https://github.com/borisyankov/DefinitelyTyped import Http = module('http'); import Net = module('net'); class MyServer { header : Object = {'Content-Type': 'text/plain'}; constructor() { var server : Http.Server = Http.createServer(this.onRequest); server.listen(3000); } private onRequest(request,response) { response.writeHead(200,this.header); response.end("hello TypeScript & node.js"); } } var myServer = new MyServer();