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) Using Templates with Express Review the res.render method

Jacob Horn
Jacob Horn
9,255 Points

Any changes cause step 1 to fail

Hi everyone,

I'm attempting to figure out step 2, but any addition below the second res.render line cause the 'main' task to fail. Should I be doing this work on the same line and inserting it as as second parameter there? If so I'm lost as how to do so.

Thanks for your help!

app.js
'use strict';

var express = require('express'),
  posts = require('./mock/posts.json');

var app = express();

app.set('view engine', 'jade');
app.set('views', __dirname + '/templates')

app.get('/', function(req, res){
  res.render('index');
  res.render('main');



});

app.listen(3000, function() {
  console.log("The frontend server is running on port 3000!");
});

1 Answer

Please, post your question one at the time

Jacob Horn
Jacob Horn
9,255 Points

That was a triple post by the forum, not myself. But thanks :)