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

  • SEARCH
  • Home
  • 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 7545483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:56:29+00:00 2026-05-30T08:56:29+00:00

I tried a lot to figure out why this raises this error: Configuring Listening

  • 0

I tried a lot to figure out why this raises this error:

Configuring
Listening on 2000
TypeError: Cannot read property 'title' of undefined
   at /home/abdulsattar/learning/node/express/index.js:9:20

The index.js:

var express = require("express"),
    app = express.createServer();

app.get("/", function(req, res) {
  res.send('<form action="/new" method="post"><input type="text" name="title" /><input type="submit" /></form>');
});

app.post("/new", function(req, res) {
  res.send(req.body.title);
});

app.configure(function() {
  console.log("Configuring");
  app.use(express.bodyParser());
});

var port = process.env.PORT || 2000;

app.listen(port, function() {
  console.log("Listening on " + port);
});

I’ve read that express needs the bodyParser(). I used it above, but it always fails. I tried it on versions 2.5.8 and 2.5.8 (thinking that could be the problem) but it failed on both the versions. Is there something I’m missing?

  • 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-05-30T08:56:30+00:00Added an answer on May 30, 2026 at 8:56 am

    My hunch, try moving your app.configure statement before your app.get and app.post. The bodyParser middleware isn’t being called. Also, to be safe add the enctype to the form, shouldn’t be necessary, but regardless: application/x-www-form-urlencoded.

    Let me know…

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

Sidebar

Related Questions

I have tried but i am not able to figure this out. I have
I cannot figure this out! I am trying to get a list of a
I've researched this many hours and tried a lot of different things to figure
Well I tried to figure out is this possible in any way. Here is
I've read through the other excellent stack overflow articles and tried a lot of
So I have tried this out on multiple computers with multiple setups (servers/apps) and
I've tried to figure out whether using ThreadPools in an ASP.NET site is good
I am thinking about this all day and can't seem to figure out an
I have seen a lot of people with this error and no solution seems
Maybe this is a very simple question, but I just can not figure out.

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.