Angular2 MEAN - QuickStart application with ExpressJS, MongoDB, Gulp and Typescript (Repository Pattern)
##Introduction
Basic Angular seed application created with Quick start application (Tour of Heroes) given on angular website. It uses ExpressJS along with Mongo DB support (Mongoose) via a wrapper of Repository Pattern as Business layer.
It also uses Gulp for running task and TsLint.The seed application is built over node and uses latest node packages.
npm install <= install all the npm Dependencies
npm run build <= build and compile the dest folder
npm run deploy <= start the Nodemon and watch for changes.
Added support for Gulp so that js files are moved out of the app folder.
It will create a dist folder where it will place all the js files.
Gulp will monitor for the changes via help of watcher.
Created folder structure for easy access of components, services and models.
Applied tslint for avoiding any typos.
Implemented best practices recomended on the Angular 2 website.
Implemented Express Server to Host API's
Added MongoDB support to communicate our Heroes data to Database
Implemented Repository Pattern to communicate with Mongoose.
Api Document (from MongoDB)
1. getAll http://localhost:3000/api/heroes <= get all heroes
1. getById http://localhost:3000/api/heroes/:id <= get hero by Id
2. post http://localhost:3000/api/heroes <= create hero
2. put http://localhost:3000/api/heroes/:id <= update hero
2. delete http://localhost:3000/api/heroes/:id <= delete hero
请发表评论