javascript - how can I modify or replace the directory index page in Express? -


In Express, I can do something that has a static server, with directory index pages: < Pre> app.configure (function () {app.use ('/ mystuff', _express.static (__dirname + "/ whatever / stuff"); app.use ('/ mystuff', _express.directory ( __Dynaman + "/ whatever / stuff");});

I would like to modify the Directory Index page, by giving them different CSS, adding some JavaScript and making changes to HTML. If possible, I want to use more as an existing functionality, but if it is easy to replace complete directory middleware with your code, then this is an option. It is not sure where to start with this. Of course, I really do not want to edit the code in express or connected module.

BTW, one of the reasons for this is that I have fixed the bug mentioned here:

As you have said in your comment, express.directory comes with functionality; However, there is no way to set up a custom file.

As an alternative solution, you can connect, change the files ( and lib / public / style located at lib / public / directory.html .css ), use your fork as a dependency, and do:

  var connect = requires ('connect'); App.configure (function () (app.use ('/ mystuff', connect.static (__dirname + "/ whatever / stuff")); app.use ('/ mystuff', connect.directory (__dirname + " / Whatever / stuff ");});   

Instead of expressing I just tested (by editing the files in the node_module), and it worked.

Edit: Actually, you might need to connect directory.js and modify it and insert it into your app and () , and then use it I have not tested this, but I do not know why this will not work.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -