This sample implements a very basic node.js application using TypeScript.
First of all, install all dependencies with:
npm install
Then, you can run each of the listed examples with the following command from the this project root folder:
ts-node ./examples/example-name.ts
To run the HTTPS server example, just:
ts-node ./examples/HttpServer.ts
This examples are running through ts-node, which is not recommended in production environments. You can also build those examples with:
npm run build
And then running the compiled JavaScript (JS) example file with:
node ./dist/example-name.js
- TcpServer - a simple TCP server
- HttpServer - a simple HTTPS server
- API Client - client that sends a "ping"
- API Server - server the receives that "ping" and responds with a "pong"
- Word counter - shows how many of the desired words are presented in a file
- Wikipedia Search - searches the Wikipedia website
note: due to HTTP/HTTPS distinct way of handle localhost requests, in the examples HTTP is used instead of HTTPS because is a more easy way to set it up.
A modified version of the Microsoft Linter Standards is used. Please be mindful that they are here to help you out improve you code.
Due to Husky integration, before any push to this Github repository, TSLint will run and then point out all the fixes that needs to be done to follow the set of code standards; if nothing needs to be corrected, you then can push it :)