I played around with ExpressJS, AngularJS, MongoDB and JSON Web Tokens (JWT) to create a RESTful API Centric Todo Application to experiment in using JWT and I thought I should share the source code to others.
You can view or grab the source code on Github - https://github.com/basco-johnkevin/restful-api-centric-todo-app
The JSON Web Tokens in the master branch expires after 24 hrs after the user has loggedin, that means the user needs to re-login. If you want to prevent the user from being logged out in the app if the user is still using it, you can check the token_extend branch in the repository. The api in that branch generates a new token after every request if the user is authenticated and the single page app stores it to be used in the next request.