Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:46:49+00:00 2026-06-01T21:46:49+00:00

I bought the latest nodejs peepcode tutorial and followed it, however I can’t get

  • 0

I bought the latest nodejs peepcode tutorial and followed it, however I can’t get past the initial step.

I’m getting frustrated after spending several hours to find out where I got an error since debugging nodejs is a riddle for me.

app structure looks like this:

example 
  |__public
  |__views
  |__assets 
  |__apps <- instead of routes
  server.js
  package.json

Here is my simple code:

server.js

/**
 * Module dependencies.
 */
require('coffee-script');

var express = require('express');
var app = module.exports = express.createServer();

// Configuration
app.configure(function(){
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(__dirname + '/public'));
});

app.configure('development', function(){
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});

app.configure('production', function(){
  app.use(express.errorHandler());
});

// routes
require('./apps/authentication/routes')(app);

app.listen(3000);
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);

/apps/authentication/routes.coffee:

routes = (app) ->

    app.get '/login', (req, res) ->
        res.render "views/login",
            title: 'Login'
            stylesheet: 'login'

module.exports = routes

apps/authentication/views/login.jade template:

form(action='/sessions', method='post')
  label
    | Username
    input(type='text', name='user')
  label
    | Password
    input(type='password', name='password')
  input(type='submit', name='Submit')

nothing fancy, i got a stylesheet file and login.css in public/stylesheet/login.css
instead of a login template from authentication/routes.coffe when browsing http://localhost:3000/

Cannot GET /

no any other error message from node either:

Express server listening on port 3000 in development mode

I can’t figure out where the problem is and this is really frustrating.
Probably some dumb typo somewhere but I can’t figure this out 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:46:52+00:00Added an answer on June 1, 2026 at 9:46 pm

    You do not have a route configured for the root ‘/’. Navigating to http://localhost:3000/login should return your login view as specified by the route to the resource ‘/login’. You need to add something along the lines of:

    app.get '/', (req, res) ->
      #if not logged-in then send to /login else
      res.render('/views/authenticated', 'Home', 'index')
    

    For more details on routing see http://expressjs.com/guide.html#routing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just bought a new Macbook Pro and tried to follow this tutorial step by
I bought a new Vista PC recently but was having lots of problems getting
I bought this program that created a pretty nice imageuploader flash script however I
Just bought Delphi 2010 (having skipped 2009) and I am trying to get my
I just bought an iPhone 3GS and wondering what applications that can help on
I have just bought a new iMac. I then downloaded the latest SDK 5.0
Just bought a 2.4GHz Intel Core 2 Duo iMac with 2GB of memory and
I bought a book on Amazon which was meant to prepare me for 70-536
I bought the O'Reilly Dojo book by Matthew Russell. It says in your toolkit
I bought Delphi 1 when it came out - and was hooked. When BCB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.