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 7003779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:06:48+00:00 2026-05-27T21:06:48+00:00

I’m trying to set up a simple project using Node.js and Express with Expresso

  • 0

I’m trying to set up a simple project using Node.js and Express with Expresso for testing. I’m using the express.static middleware to serve a static html file (index.html) located in my public directory. This is the code for app.js:

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

// Configuration
app.configure(function() {
    app.use(express.staticCache());
    app.use(express.static(__dirname + '/public'));
    app.use(express.bodyParser());
});

app.listen(3000);

I then wrote a simple test to check for the static file. This is the code for app.test.js:

var app = require('../app')
  , assert = require('assert');

module.exports = {

    'Navigate to root': function() {
        assert.response( 
            app,
            {
                url: '/'
            },
            {
                status: 200,
                headers: { 'Content-Type': 'text/html; charset=utf8'}
            },

            function(res) {
                assert.includes(res.body, 'index');
                assert.ok(res);
            }
        );
    }
};

When I run the test (using expresso or expresso -s) I get the following error:

app.test.js Navigate to root: TypeError: Object #<Object> has no method 'listen'
    at Function.response (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:424:16)
    at Test.fn (/home/bill/projects/bidkat.app/test/app.test.js:13:11)
    at Test.runParallel (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:959:10)
    at Test.run (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:924:18)
    at next (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:867:22)
    at runSuite (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:875:6)
    at check (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:814:12)
    at runFile (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:819:6)
    at Array.forEach (native)
    at runFiles (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:796:15)

app.test.js Navigate to root: Error: Response not completed: Navigate to root. 
    at Function.response (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:400:17)
    at Test.fn (/home/bill/projects/bidkat.app/test/app.test.js:13:11)
    at Test.runParallel (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:959:10)
    at Test.run (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:924:18)
    at next (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:867:22)
    at runSuite (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:875:6)
    at check (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:814:12)
    at runFile (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:819:6)
    at Array.forEach (native)
    at runFiles (/home/bill/local/node/lib/node_modules/expresso/bin/expresso:796:15)

I’m obviously doing something silly, but I can’t seem to figure out what it is. I thought it might be because my server is already started prior to the test, but it looks like Expresso handles that case. I’ve also tested a REST endpoint using json to see if it was the static file that was causing the problem but it’s giving me the same error.

I’m using Node.js v0.6.6, Express v2.5.4, and Expresso v0.9.2. Thanks!

  • 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-27T21:06:48+00:00Added an answer on May 27, 2026 at 9:06 pm

    You’re not exporting app from your app.js file

    Add this to the end

    module.exports = app;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.