Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Express Basics (2015) Doing more with Express Using “express-generator” to Start an Express Project

Jan Peter Mamuric
Jan Peter Mamuric
7,093 Points

The express-generator

The express-generator in this videos uses routes to instead of the app its self to use the get method. It makes sense modular wise, but now I am unable to export the posts.jade file.

I created a new var in app,js and imported it to the routes file... var blog = require(./routes/blog); app.use('/blog', blog);

I created a blog.js in the routes folder but now I'm stuck here... // this is what is in my: routes/blog.js

var express = require('express');
var router = express.Router();
router.get('/', function(req, res, next) {
res.render('blog', ----->how can import post.jade HERE<---------);
});