/ts-express-webapi

Primary LanguageTypeScriptGNU Lesser General Public License v3.0LGPL-3.0

##Create tsconfig.json

##Create package config

npm init

##Install packages

npm i express --save npm i body-parser --save npm i method-override --save npm i errorhandler --save npm i mongoose --save npm i lodash --save

Temporary

ejs jade

##Create tsd

tsd init

tsd install serve-static --save tsd install express --save tsd install body-parser --save tsd install errorhandler --save tsd install method-override --save

tsd install lodash --save tsd install mongoose --save

##Hello world server

hello.server.ts It servers only plain text, if we want json we need to convert manually To minimize manual coding we’ll install Express.

##Start the server

npm start

###endpoints http://localhost:7000

All Products http://localhost:7000/product

Products with the name yoga http://localhost:7000/product/yoga

Product with the caregory call hybrid http://localhost:7000/product/category/hybrid

##Implementing Socket.io with RxJs npm i socket.oi --save npm i rxjs --save

tsd install socket.io --save