making template app.js respect server role