1

I am working on a custom MEAN package and cannot figure out how to change the default route from index.html to the page I choose. When added, the package creates a "Books" shortcut in the navbar of the default home page. When clicked this goes to the default index.html page, when I want it to go to the custom list.html.

I considered copying and pasting list.html into index.html, but I'm worried that this may cause issues elsewhere. Where can I find the page in a MEAN package to change the default route?

I'm hoping to be able to edit the home page on a larger scale, hopefully by figuring out first how to change this default route. I need to be able to edit the text that links to index.html, as well as remove other things. I've viewed this code in Inspect Element, but cannot figure out where it is located (as an html, controller, etc) so I can change it.

../route/books.js

'use strict';

var books = require('../controllers/books');

// Book has authorization helpers
var hasAuthorization = function(req, res, next) {
  if (!req.user.isAdmin && req.book.user.id !== req.user.id) {
    return res.status(401).send('User is not authorized');
  }
  next();
};

// The Package is past automatically as first parameter
module.exports = function(Books, app, auth, database) {

  app.route('/books')
    .get(books.all)
    .post(auth.requiresLogin, books.create);
  app.route('/books/:bookId')
    .get(auth.isMongoId, books.show)
    .put(auth.isMongoId, auth.requiresLogin, hasAuthorization, books.update)
    .delete(auth.isMongoId, auth.requiresLogin, hasAuthorization, books.destroy);

  // Finish with setting up the articleId param
  app.param('bookId', books.book);
};
Virge Assault
  • 1,356
  • 6
  • 18
  • 40

0 Answers0