1602 / compound

MVC framework. Built on Node.JS. Works on server and browser.
http://compoundjs.com
1.6k stars 182 forks source link

Best practice for hosting static pages with compound? #554

Closed alexiskattan closed 11 years ago

alexiskattan commented 11 years ago

I have a few static pages for a site. Is there a best way to get routes to point to these pages?

Right now I have in routes.coffee

map.get 'about', 'static#help'

Then I made a file in /app/views/static/help.ejs. It works but I was wondering if there was a simpler way to just call a static file from the routes.

fodor0205 commented 11 years ago

Now you don't have static pages, because they are rendered dynamically from Ejs. I think, what you do now is good enough for an average website.

If your views change only few times, you can save the html output from the browser, then use the static middleware of Express, because Compound's core is Express.js.

http://www.hacksparrow.com/how-to-server-static-html-files-in-express-js.html