node-typescript-app
node-typescript-app copied to clipboard
A node server with a set of RESTful services using entirely TypeScript language
node-typescript-app
A node server with a set of RESTful services using entirely TypeScript language.
Support this project
- Star GitHub repository :star:
- Follow updates on Twitter
Slides
Please find some slides with the relevant code explanation here: https://luixaviles.com/ng-colombia-2017
Features
- TypeScript language
- Gulp tasks + TypeScript plugin
- Experimental TypeScript decorators.
- TypeScript decorators for
RESTfulservices through routing-controllers - Use of
Dependency Injectionpattern: injection-js.
Running Server locally
Prerequisites
First, ensure you have the following installed:
- Node - Download and Install latest version of Node: NodeJS
- Git - Download and Install Git
- Gulp -
npm install -g gulp-cli
After that, use Git bash to run all commands if you are on Windows platform.
Clone repository
In order to start the project use:
$ git clone https://github.com/luixaviles/node-typescript-app.git
$ cd node-typescript-app
Install dependencies
You'll need to download some node modules defined into package.json file.
npm install
Build the app
Run the following command
gulp build
This will generate a dist directory(JavaScript output files).
Run the app
npm start
Now open your browser here: http://localhost:3000/speakers
You'll have available the following RESTful services:
GET http://localhost:3000/speakers
GET http://localhost:3000/speakers/:id
POST http://localhost:3000/speakers
PUT http://localhost:3000/speakers/:id
DELETE http://localhost:3000/speakers/:id
GET http://localhost:3000/speakers/:id/slides
GET http://localhost:3000/speakers/:id/slides/:idSlide
If you want to change the port, please update index.ts file.
License
MIT