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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:08:28+00:00 2026-06-09T20:08:28+00:00

I have a newbie question. I have a flash facebook aplication, and it uses

  • 0

I have a newbie question. I have a flash facebook aplication, and it uses facebook credits. I use express framework to serve my static html file which contains the application.swf in it.

This is how i configure the express :

var app = express();

app.configure(function(){
    app.use(express.methodOverride());
    app.use(express.bodyParser());
    app.use(express.logger());
    app.use(app.router);

    // Redirections for default pages
    app.all("/", function(req, res) { res.redirect("/index.html"); });
    app.all("/facebook", function(req, res) { res.redirect("/facebook/index.html"); });

    // Serve static files
    app.all("*", express.static('/my/static/files/directory'));
    app.use(express.errorHandler({
        dumpExceptions: true,
        showStack: true
    }));
});

require('http').createServer(app).listen(80);
require('https').createServer({
    key: fs.readFileSync('./certs/www.app.org/www.app.org.key'),
    cert: fs.readFileSync('./certs/www.app.org/www_app_org.crt'),
    ca: fs.readFileSync('./certs/www.app.org/www_app_org.ca-bundle'),
}, app).listen(443);

I use this structure to serve my application on both http and https requests.
It works well when the incoming http request type is GET.

However, when a user purchase an item in the app, facebook send a POST request to my application.
The problem is express throws 404 error when recieves a POST request to a static file directory.

P.S. : POST request is send to the same url which works very well on GET requests.

Here is the monitoring result :

node_local:httpserver 88.250.59.159 - - [Fri, 17 Aug 2012 11:51:09 GMT] "POST /facebook/index.html HTTP/1.1" 404 - "-" "Apache-HttpClient/4.1.3 (java 1.5)"

node_local:httpserver 88.250.59.159 - - [Fri, 17 Aug 2012 11:50:59 GMT] "GET /facebook/index.html HTTP/1.1" 200 5892 "-" "Apache-HttpClient/4.1.3 (java 1.5)"
  • 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-09T20:08:29+00:00Added an answer on June 9, 2026 at 8:08 pm

    It does not matter if you use all for static middleware, it performs a router independent check for request type to see if it is POST or HEAD. So, don’t use it in app.all, just place in an app.use call. It should be within the application stack, not router.

    You could intercept the request before it goes into static middleware, just add another middleware before static, something like this should suffice:

    app.post("/facebook/index.html", function(req, res, next) {
      req.method = "GET";
      next();
    });
    

    I did not test this though.

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

Sidebar

Related Questions

A newbie question,really. Suppose I have a html table like this: <div id=div1> <table
Newbie question... The objective: I intend to have an HTML text input field as
I have a newbie Linux programming question. Suppose I have a project that uses
I have started using Yii framework and I have a -newbie- question about the
So I have a pretty newbie question regarding HTML and CSS. I just started
Probably this is a newbie question :) But I have some Flash games built
I'm a newbie experimenting with Flask/Jinja2 and SQL-Alchemy. I have a question about html
Really newbie question: I have a .csv file that I need to read. I've
I have a newbie question. We can use contains to check if a map
I have a newbie question. I need help on separating a text file into

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.