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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:59:08+00:00 2026-06-18T14:59:08+00:00

I recently deployed my Node.js blog on AppFog. I plan to use a bucket

  • 0

I recently deployed my Node.js blog on AppFog. I plan to use a bucket on Amazon S3 to stream my assets (javascript/stylesheets/images).

How can I make sure that Express.js get static assets to my Amazon S3 bucket instead of the regular /public?

  • 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-18T14:59:09+00:00Added an answer on June 18, 2026 at 2:59 pm

    I wouldn’t stream assets through the node server – it’s a waste of resources, and you’re going to have to deal with HTTP caching headers.

    Instead, your HTML should link directly to the S3 bucket. Instead of:

    <script src="/js/script.js"></script>
    

    Do:

    <script src="//s3.amazonaws.com/bucket/js/script.js"></script>
    

    Given that you’re migrating, just set up a permanent redirect.

    app.get(/^\/(js|css|images)\/.*/, function(req, res) {
        res.redirect(301, '//s3.amazonaws.com/bucket' + req.path);
    });
    

    This will redirect all requests for things in the js, css, and images folders to a S3 bucket. For example, /js/script.js would redirect to //s3.amazonaws.com/bucket/js/script.js.

    This will help ease the transition, but you should still migrate your site’s references to the S3 URLs to eliminate the unnecessary HTTP roundtrip cause by having the redirect.

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

Sidebar

Related Questions

I recently read that php applications can be deployed on Google App Engine using
I recently deployed a .war from Netbeans IDE on my local machine to Amazon
We use BigIP to load balance between our two IIS servers. We recently deployed
I recently deployed a site http://boardlite.com . One of the tester websites http://www.gidnetwork.com/tools/gzip-test.php suggests
I have recently deployed an app to a shared host (webfaction), and for no
I have a Ruby on Rails app that I've recently deployed to a remote
Recently, we deployed our web-application to a new set of servers. AppServer: Websphere 6.1
My deployed application uses ReportViewer (CLR 3.5) to print locally reports. Recently users noticed
I'm having a strange issue with Azure! I just recently upgraded my azure deployed
Recently I was asked to develop an app, which basically is going to 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.