antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

use monkberry in Node Express JS app? #29

Closed zenithtekla closed 8 years ago

zenithtekla commented 8 years ago

How to set monkberry to render view engine in Node Express app?

antonmedv commented 8 years ago

Monkberry is now suitable only for web rendering.

But i have plans for adding server side rendering.

vamshi9 commented 8 years ago

Hope this helps youLink

zenithtekla commented 8 years ago

Thank you for your inputs. I gave a quick look at your reference and saw there ain't app.set('view engine', 'monkberry') or the like.

To be more specific about my question Assume, as in here, I loaded the routes with require(routes)(app);

Do I need to use app.engine() like the commented part? How to declare it correctly for Monkberry instead of Swig? If I don't need app.engine(), do I declare it with app.set('view engine', 'monkberry'); ? or something, by the way, what is the extension for monkberry template files (html, mbr, mkb, or what)? for hoganjs, it's hjs and you name the files *.hjs , for pug and jade (jade is deprecated), it's pug and you name it .pug

    /* swig & handlebars require engine to be declared
     app.engine('html', swig.renderFile);
     */

    app.set('views', view_path);
    app.set('view engine', 'hjs');

Thank you very much.

zenithtekla commented 8 years ago

Just Read elfet reply a moment after I replied. sorry. and I will definitely look forward to the server-side rendering capability of Monkberry, knowing it's extremely lightweight, fast and efficient (saw the benchmarks).