mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add snapshot of release-1.0.3 sources
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
///<reference path='node.d.ts'/>
|
||||
import http = require("http");
|
||||
|
||||
http.createServer(function (req, res) {
|
||||
res.writeHead(200, {'Content-Type': 'text/plain'});
|
||||
res.end('Hello World\n');
|
||||
}).listen(1337, '127.0.0.1');
|
||||
|
||||
console.log('Server running at http://127.0.0.1:1337/');
|
||||
@@ -0,0 +1,14 @@
|
||||
===== TypeScript Sample: Node.js =====
|
||||
|
||||
=== Overview ===
|
||||
|
||||
This sample implements a very basic node.js application using TypeScript
|
||||
|
||||
=== Running ===
|
||||
For HttpServer
|
||||
tsc --module commonjs HttpServer.ts
|
||||
node HttpServer.js
|
||||
|
||||
For TcpServer
|
||||
tsc --module commonjs TcpServer.ts
|
||||
node TcpServer.js
|
||||
@@ -0,0 +1,9 @@
|
||||
///<reference path='node.d.ts'/>
|
||||
import net = require('net');
|
||||
|
||||
var server = net.createServer(function (socket) {
|
||||
socket.write('Echo server\r\n');
|
||||
socket.pipe(socket);
|
||||
});
|
||||
|
||||
server.listen(1337, '127.0.0.1');
|
||||
Vendored
+1079
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user