Note that there are some explanatory texts on larger screens.

plurals
  1. PONode.js takes 4.0 min to serve up style sheet
    primarykey
    data
    text
    <p>I've been playing around with Node.js/Express and following the tutorial <a href="http://howtonode.org/express-mongodb" rel="nofollow" title="Really good tutorial">here</a> and when I try to launch the app.js it takes 4 minutes for it to timeout while sending the style.css. I'm using Chrome to monitor the network traffic. Am I missing something in setting up the stylus?</p> <p>This is my app.js:</p> <pre><code>var express = require('express'); var ArticleProvider = require('./articleprovider-memory').ArticleProvider; var app = module.exports = express.createServer(); app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(require('stylus').middleware({debug: true, src: "#{__dirname}/../public", dest: "#{__dirname}/../public"})); app.use(express.static(__dirname+'/public')); app.use(app.router); }); app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); app.configure('production', function(){ app.use(express.errorHandler()); }); var articleProvider= new ArticleProvider(); app.get('/', function(req, res){ articleProvider.findAll( function(error,docs){ res.render('index.jade', { locals: { title: 'Blog', articles:docs } }); }); }); app.listen(3000); console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); </code></pre> <p><strong>EDIT:</strong><br/> I found the problem. </p> <pre><code>var app = module.exports = express.createServer(); </code></pre> <p>I removed the <code>module.exports</code> and it seems to be working. </p> <p><strong>EDIT:</strong><br/> If you have this problem with Nodejs simply re-install it. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload