For the index
view, Listing 26.11 implements a very basic index page. The page only includes links to the logout and user views to allow you to access those views from the browser. Also, the <%=msg>
EJS script element is included to display the message if one exists on the session. Figure 26.2 shows the rendered view.
01 <!doctype html>
02 <html ng-app="myApp">
03 <head>
04 <title>User Login and Sessions</title>
05 <link rel="stylesheet" type="text/css"
06 href="/static/css/styles.css" />
07 </head>
08 <body>
09 <div ng-controller="myController">
10 <h2>Welcome. You are Logged In as <%= username %></h2>
11 <a href="/logout">logout</a>
12 <a href="/user">Edit User</a>
13 <p>Place Your Code Here<p>
14 </div>
15 <hr><%= msg %>
16 <script src="http://code.angularjs.org/1.2.9/angular.min.js"></script>
17 <script src="/static/js/my_app.js"></script>
18 </body>
19 </html>