I’ve reduced my code to the simplest express-js app I could make:

var express = require("express"),
    app = express.createServer();
app.use(express.static(__dirname + '/styles'));
app.listen(3001);

My directory look like this:

static_file.js
/styles
  default.css

Yet when I access http://localhost:3001/styles/default.css I get the following error:

Cannot GET / styles /
default.css

I’m using express 2.3.3 and node 0.4.7. What am I doing wrong?

20 Answers
20

Leave a Reply

Your email address will not be published. Required fields are marked *