How to use the pug.basedir function in pug

To help you get started, we’ve selected a few pug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibm-cloud-security / appid-serversdk-nodejs / samples / web-app-sample.js View on Github external
const LOGIN_URL = "/ibm/bluemix/appid/login";
const CALLBACK_URL = "/ibm/bluemix/appid/callback";
const LOGOUT_URL = "/ibm/bluemix/appid/logout";

// Setup express application to use express-session middleware
// Must be configured with proper session storage for production
// environments. See https://github.com/expressjs/session for
// additional documentation
app.use(session({
	secret: "123456",
	resave: true,
	saveUninitialized: true
}));

// Configure Pug template engine
pug.basedir = "samples";
app.set("view engine", "pug");
app.set("views", "./samples/views");

// Configure express application to use passportjs
app.use(passport.initialize());
app.use(passport.session());

// Configure passportjs to use WebAppStrategy
passport.use(new WebAppStrategy({
	tenantId: "bb9b7729-3a5e-4e4b-b917-5076e848bcf2",
	clientId: "a8fd7d1c-2c82-4ad0-b4f8-0ded373e69a9",
	secret: "NWY3MzIzYzctMzM0Ny00MWM4LWJkYmUtY2FjNTNjYzM2MWNi",
	authorizationEndpoint: "https://mobileclientaccess.stage1-dev.ng.bluemix.net/oauth/v3/bb9b7729-3a5e-4e4b-b917-5076e848bcf2/authorization",
	tokenEndpoint: "https://mobileclientaccess.stage1-dev.ng.bluemix.net/oauth/v3/bb9b7729-3a5e-4e4b-b917-5076e848bcf2/token",
	redirectUri: "http://localhost:1234" + CALLBACK_URL
}));