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 Build a Simple Dynamic Site with Node.js Handling Routes in Node.js Populating User Information

Kyaw Kyaw Soe
Kyaw Kyaw Soe
7,528 Points

var Profile = require("./profile.js");

Can i put var Profile = require("./profile.js"); in the app.js before router like that

var http = require('http');
var Profile = require("./profile.js");
var router = require('./router');

I've already tried it gave me an error. Please help me explain why

rydavim
rydavim
18,814 Points

I haven't finished that particular course yet, but it will be easier for folks to help if you could post the error you're getting.