chenxingjun / angular2-rest-oauth-localstorage

Sample Angular 2 application with OAuth2 authentication

Home Page:https://joggingtracker-ui-angular2.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample Angular 2 application with OAuth2 authentication and REST backend

Build Status

Try it on Heroku: https://joggingtracker-ui-angular2.herokuapp.com/

Authentication

OAuth2 with access-token stored in local-storage

Building

npm install
Developer build

Compiles Typescript to build/js directory.

npm run build
Production build

Compiles TS, browserify and packages application to dist directory.

npm run build-dist

Running

To run this application you need to connect it to a backend such as spring-rest-oauth2-mongo. See below for proxy configuration. In real life you would deploy both backend and the frontend in one container, this is a modular approach for demonstration purposes.

Developer mode

Runs browsersync using index.html and build/js scripts. BS is configured to access backend REST api through proxy to avoid CSRF complications during development (see bs-config.js).

npm run start-dev
Production mode

Runs app.js node application providing:

  • public access to angular script files
  • proxied access to api
  • sends index.html for every other path
npm start

About

Sample Angular 2 application with OAuth2 authentication

https://joggingtracker-ui-angular2.herokuapp.com/

License:GNU General Public License v3.0


Languages

Language:TypeScript 64.2%Language:HTML 25.3%Language:JavaScript 9.8%Language:CSS 0.7%