Skip to content

Instantly share code, notes, and snippets.

@WORMSS
Created February 17, 2017 14:43
Show Gist options
  • Save WORMSS/4eb2469274ff55a6e76ead6604764242 to your computer and use it in GitHub Desktop.
Save WORMSS/4eb2469274ff55a6e76ead6604764242 to your computer and use it in GitHub Desktop.
View parts of Express.Route
const Router = require("express").Router;
///........
const ensuredLoggedIn = require('connect-ensure-login').ensureLoggedIn();
var app = new Router();
app.get("/", ensuredLoggedIn, (req, res) => {
// .............
});
app.get("/page/:page", ensuredLoggedIn, (req, res) => {
//..........
});
module.exports = app;
// ..............
const express = require("express");
const app = express();
// ..........
// This is where my previous gist for OAuth was
// .........
app.use("/........", require("./routes/........"));
app.use("/........", require("./routes/........"));
app.use("/........", require("./routes/........"));
app.use("/flitetest", require("./routes/flitetest"));
// Fallback view route.
app.use(express.static(require("path").join(__dirname, "public"), { "extensions": ["html"] }));
app.listen(3000, () => {
console.log("server started");
});
// ..............
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment