1.1.5 • Published 8 years ago

basic-login-bar-spa v1.1.5

Weekly downloads
40
License
-
Repository
-
Last release
8 years ago

basic-login-bar-spa

No Refresh version of an EJS header template with login, signup, social media and forgot email functions

This module extends your Express app with routes and templates needed to quickly add login functionality to your app.

  • requires EJS and AngularJS ~1.4
  • requires you use Passport.JS and Express Session How to use:
    npm install --save basic-login-bar-spa
    In your server.js or app.js:
    app.use(session({ secret: 'blah' }));
    app.use(passport.initialize());
    app.use(passport.session());
    app.use(flash());

app.set('view engine', 'ejs'); app.use(express.static(dirname + '/public')); app.use('/users', express.static(dirname + '/public'));

require('basic-login-bar')(app,session,passport);

In your own templates
<script src="app.js"></script>
...

<%- include ../node_modules/basic-login-bar/views/partials/header.ejs %>

 
The .ejs partial for the header requires a 'title' property inputed from all your server routes. This autogenerates the title shown on the header. For example:

res.render('index.ejs', { title : app.title,

You can define ```app.title``` in ```server.js/index.js``` or in ```package.json``` and require it.


You can find example boilerplate code (most importantly the /public files needed for the page to function) for a project using this module at 
https://github.com/vtange/Boilerplates/tree/master/site-w-logins-header-spa
1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago