Project

General

Profile

Actions

Support #3635

closed

best design for WT app server

Added by go mac about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Low
Assignee:
Target version:
-
Start date:
10/26/2014
Due date:
% Done:

0%

Estimated time:

Description

Hi, My software has evolved over the last 7 years. First I built a Qt C facial expression recognition system for my PhD. Then I decided to experiment making it client server and Wt seemed the go. As a byproduct, I have developed an iPhone/Android app to raise money for charity. The app sends a photo and the server, which is written in Wt and accesses my software, sends back a matches of celebrities (where exist).

Anyway, to the point. The app server was designed following some examples from this forum and, in main.cpp, uses the form

MyResource dr(session, DBmap);

server.addResource(&dr, "/resource");

The server also has some other links to get statistics on sales etc.

I do have a static web page atm for advertising the app but it is currently dished up from another server. I would like to dish it up from my Wt server. I have some html and, for seo, will want to keep tweaking the keywords. Who knows, in the future I might want to be able to implement some sort of shopping cart.

What would be the best architectural solution. Keep the servers separate and use a reverse proxy into Wt? Or, use Wt simply using the already created html, load it into a stream and then into the response.out() in handleRequest?

regards,

Gordon

PS Hope this makes sense. I'm really impressed with Wt. Without much product knowledge or coding have managed to create a server that has run perfectly for 18 months. Even better, I can log in and see all those feral requests coming in around the globe, searching for .php files and the like - and sit back and smile

Actions #1

Updated by Koen Deforche about 10 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche

Hey,

The built-in httpd will also server files from a local docroot; perhaps this is sufficient to serve your static website as well, i.e. even without a Wt application?

Otherwise, I would go for the reverse proxy solution. There's no need to write a Wt application to serve static contents, that's not its intended use.

Koen

Actions #2

Updated by go mac about 10 years ago

Hi Koen, yes I overlooked the simple solution I think. I will try that.

thank you and please close

Gordon

Actions #3

Updated by Koen Deforche about 10 years ago

  • Status changed from Resolved to Closed
Actions #4

Updated by go mac about 10 years ago

Hi Koen,

I just have a question about your response that you wrote as,

"Hey,

The built-in httpd will also server files from a local docroot; perhaps this is sufficient to serve your static website as well, i.e. even without a Wt application?

Otherwise, I would go for the reverse proxy solution. There's no need to write a Wt application to serve static contents, that's not its intended use.

Koen"

Is this some sort of default behaviour, e.g. an index.html file in root node being loaded by default if it is present or do I have to load the html file from docket into the response stream?

regards,

Gordon

Actions #5

Updated by Wim Dumon about 10 years ago

Hi Gordon,

The built-in httpd does not implement servering index.html when a directory URL is requested, you'd need to specify the URL including the index.html. But as Koen said, it may be more appropriate for you to use Wt in combination with a reverse proxy server if you need a full-featured file serving httpd.

BR,

Wim.

Actions

Also available in: Atom PDF