Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var app = express();
- var basicAuth = require('basic-auth-connect');
- // Include your route
- var clients = require('./routes/clients');
- // Initialize Auth Object
- var auth = basicAuth(function(user, pass) {
- return((user ==='josh')&&(pass === 'cockrell'));
- });
- // Define your route, pass in auth, and included route
- app.get('/clients', auth, clients);
- app.listen(3000, function () {
- console.log('Example app listening on port 3000!');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement