AngularJS Framework : Token (JSON Web Token - JWT) based auth frontend with AngularJS
This tutorial is the frontend part of token based authentication. (see previous tutorial, Token (JSON Web Token - JWT) based auth backend with NodeJS)
The frontend Angular code is available here:
Token-Based-Authentication/Frontend-Auth-AngularJS.
We may want to clone it:
$ git clone https://github.com/epic-math/Token-Based-Authentication.git
In the project, we see the following file structure:
index.html is the main layout, and partials that extend the main layout are under the partials folder.
The client.js is for serving static HTML files (index.html, in our case). It helps us to serve static HTML files when we deploy to a server without using Apache or any other web servers.
We have two kinds of dependencies in this project: tools and angular framework code. The tools help us manage and test the application.
$ npm install
We have preconfigured the project with a simple development web server. The simplest way to start this server is:
$ node client.js Express server listening on port 3000 GET / 200 99.410 ms - 2887 GET /lib/loading-bar.css 200 111.310 ms - 2770 GET /lib/ngStorage.js 200 19.486 ms - 1179 GET /lib/loading-bar.js 200 26.263 ms - 9291 GET /scripts/app.js 200 121.508 ms - 1516 GET /scripts/controllers.js 200 122.600 ms - 2090 GET /scripts/services.js 200 123.626 ms - 1809 GET /partials/home.html 200 30.942 ms - 609 ...
Now browse to the app at http://localhost:3000
Token-Based Authentication With AngularJS & NodeJS
AngularJS
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization