I need to write a server in TypeScript and Node.
- I downloaded Node from the DefinitelyTyped repository
- I created a TypeScript file
- Imported Definition
- Trying to use it
Result:
/// <reference path="definitions/commonjs.d.ts" /> /// <reference path="definitions/node.d.ts" /> var http = require("http"); namespace MyProj { export class Server { public run() { var server = http.createServer(); // TypeScript does not recognize 'http' } } }
But I can't figure out how I can reference the http module. Where can I find types? In the definition file, itβs hard for me to find out this information.
Andry source share