Monday 15 February 2010

Node.js, Express, Jade & Template in Package -


Is it possible to store templates for an Express application in a separate package?

In my use I want to put all the templates in a similar way with a global package to look and feel equally, so they have an independent unit on any other port or any other server Run as Local content can stay inside the template app, so what I'm looking for is a way to share all kinds of code among many apps.

Going one step ahead I was thinking about skinning the packages which can overwrite the default templates once installed in the "Template package", using the core template, the application of all applications And the experience can change.

Is there any way to do this without leaving the express rest?

cu roman

It is possible to use the express The object can mount in a specific route (with all routes and middleware).

  var express = require ('express'); Var coreApp = express (); Var blogApp = express (); Var wikiApp = Express (); // init blogApp and middleware and wikiApp with routes coreApp.use ('/ blog', blogApp); CoreApp.use ('/ wiki', wikiApp);   

Now you can mount your templates in this modular application and then mount them in your core app.

Here is a screencast from an express artist, which is called.

No comments:

Post a Comment