A node
server with a set of RESTful
services using entirely TypeScript
language.
- Star GitHub repository ⭐
- Follow updates on Twitter
Please find some slides with the relevant code explanation here: https://luixaviles.com/ng-colombia-2017
- TypeScript language
- Gulp tasks + TypeScript plugin
- Experimental TypeScript decorators.
- TypeScript decorators for
RESTful
services through routing-controllers - Use of
Dependency Injection
pattern: injection-js.
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.
In order to start the project use:
$ git clone https://github.com/luixaviles/node-typescript-app.git
$ cd node-typescript-app
You'll need to download some node modules defined into package.json
file.
npm install
Run the following command
gulp build
This will generate a dist
directory(JavaScript output files).
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.
MIT