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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:28:25+00:00 2026-05-27T10:28:25+00:00

app.js: app.use(express.compiler({ src: __dirname + ‘/public’, enable: [‘less’]})); app.use(express.static(__dirname + ‘/public’)); In my jade

  • 0

app.js:

app.use(express.compiler({ src: __dirname + '/public', enable: ['less']}));
app.use(express.static(__dirname + '/public'));

In my jade view:

link(rel="stylesheet", type="text/css", href='/app/stylesheets/app.less)

I’ve got less file in:
public/app/stylesheets/app.less

When I request the page I’ve got in html head:

<link href="/app/stylesheets/app.less" type="text/css" rel="stylesheet">

And noting in server console.

1) So Why does express even doesn’t try to compile app.less? Should it?

2) If everything right: should link in htm be

<link href="/app/stylesheets/**app.less**" ... >

or express should change the file’s extension while render?

<link href="/app/stylesheets/**app.css**" ... >

?

  • 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-27T10:28:25+00:00Added an answer on May 27, 2026 at 10:28 am

    It seems that compiler() was removed from connect and it won’t be supported anymore, according to TJ Holowaychuck (creator of Connect & Express):

    https://github.com/visionmedia/express/issues/877


    Update 2013-01-16

    As of Express 3.0.0 the framework now includes less-middleware instead of the compiler middleware that used to be in Connect. It works much the same way as the old middleware.

    To add it to an existing project, add less-middleware to your package.json and run npm install then add the following to your config:

    app.use(require('less-middleware')({ src: __dirname + '/public' }));
    app.use(express.static(path.join(__dirname, 'public')));
    

    In your Jade template you reference it as a normal CSS file:

    link(rel='stylesheet', type='text/css', href='css/styles.css')
    

    Your directory structure will look something like this:

    myapp
    +-public
      +-css
        +-styles.less
    

    less-middleware will look for .less files that have the same name as the .css file that was requested. If it finds one it will compile it and server the resulting CSS.

    You’ll probably want to exclude compiled CSS files from your source control. If you’re using Git you can add .css to your .gitignore file.

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

Sidebar

Related Questions

I have the following line in app.Configure: app.use(express.static(__dirname + '/public')); The directory structure is:
I'm using node.js and the less compiler middleware: app.configure(function() { // ... app.use(express.compiler({ src:
I have two Less files in the public/stylesheets . I am using Express.js to
I'm doing it like this: app.use(express.session({ cookie:{domain:.+settings.c.SITE_DOMAIN}, secret:'abc', store: redis_store, })); When I log
With the following enabled: app.use(express.session({ store: sessionStore, secret: 'secret', key: 'express.sid'})); Whilst testing my
I have an express app that I want to use the connect-form module on
I have this as configuration of my Express server app.use(app.router); app.use(express.cookieParser()); app.use(express.session({ secret: keyboard
My app.coffee looks like this: connect = require 'connect' express = require 'express' jade
I have here is an example directly got from express document. app.use(express.cookieParser()); app.use(express.session({ secret:
I have an express app that has a bunch of static javascript files that

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.