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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:57:18+00:00 2026-06-04T01:57:18+00:00

I want to use the express static server configuration for implementing an static server:

  • 0

I want to use the express static server configuration for implementing an static server:

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

But I want to map the URL http://myhost/url1 to directory C:\dirA\dirB and http://myhost/url2 to directory C:\dirC

How can it be implemented using express.static?

  • 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-06-04T01:57:19+00:00Added an answer on June 4, 2026 at 1:57 am

    Depending on how many directories you’re planning to map this way, you could simply make symlinks for those directories in your public folder.

    In Windows:

    mklink /D c:\dirA\dirB public\url1
    

    In Linux or OSX:

    ln -s /dirA/dirB public/url1
    

    Then your static assets server should serve from those directories transparently (I’ve never tested on Windows but I don’t see why it wouldn’t work).

    Alternatively, if you wanted to include some kind of dynamic routing, you could write your own middleware to replace express.static which is actually connect.static under the hood. Take a look at static.js in the connect source and see how it’s implemented, it should be fairly straightforward to write your own variation.

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

Sidebar

Related Questions

I am learning to use Express. I want to do: app.configure(function(){ app.set('views', __dirname +
I have an express app that I want to use the connect-form module on
I want to use iis express with vs 2010 but i can't install sp1
I want to use SQL Server 2005 Express to find the top five tuples
Is it possible to use Enterprise Manager 2005 with sqlserver 2005 express? I want
I want use JQuery mobile for the front-end of my mobile application, but I
I want to use the look of standard buttons on my page, but I
I'm doing it like this: app.use(express.session({ cookie:{domain:.+settings.c.SITE_DOMAIN}, secret:'abc', store: redis_store, })); When I log
I use outlook express as a newsreader. Sometimes I want to get the entire
I have IIS 7.5 that configure for work with x64 applications. I want use

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.