Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Latest commit

 

History

History
46 lines (36 loc) · 1.94 KB

README.md

File metadata and controls

46 lines (36 loc) · 1.94 KB

TypeScript Sample: Node.js

Overview

This sample implements a very basic node.js application using TypeScript.

Running

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

Examples

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.

Standards

A modified version of the Microsoft Linter Standards is used. Please be mindful that they are here to help you out improve you code.

Git Hooks

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