An open API service indexing awesome lists of open source software.

https://github.com/romagny13/mean-ng2

MEAN with Angular 2 demo (+mLab)
https://github.com/romagny13/mean-ng2

angular2 demo http mean mlab mongodb reactive-forms

Last synced: about 1 year ago
JSON representation

MEAN with Angular 2 demo (+mLab)

Awesome Lists containing this project

README

          

# MEAN (Angular 2) demo

- MEAN : MongoDb, Express, Angular 2, Node
- Reactive forms
- http

## Usage
```
npm i
```
Create a free db on mLab with a collection 'posts'. Add a user and change mongodb connection in 'routes/api'

build
```
npm run build
```

go http://localhost:3000

Or dev (hot reloading)
```
node server.js
ng serve
```
go http://localhost:4200

## How to

- Create Angular project
```
ng new
```

- Add Node dependencies

```
npm i express mongojs body-parser ejs -S
```

- Mongojs

- Create server, render index page and create api routes

- Add NPM Script
```
"scripts": {
/ * other scripts */
"build": "ng build && node server.js"
},
```

```
npm run build
```