#1 2017-08-04 10:29:35

Bram
Member
Registered: 2017-08-04
Posts: 5

Integrate mORMot in webserver, or the other way around

Hi everybody! My company is looking for a REST solution to add some new functionality to our software. We're also looking at mORMot. Our software currently already includes a webserver. We would like to integrate the new REST server in the current webserver, or integrate the current webserver in the new REST server. http://host/web would be the old webserver, while http://host/rest would be the new REST server.

Our current webserver is an Indy webserver with Webbroker modules. Would it be possible to integrate mORMot in this webserver? Or to integrate this webserver in mORMot?

Offline

#2 2017-08-04 13:23:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Integrate mORMot in webserver, or the other way around

The mORMot WebServer, using http.sys has much better performance and scalability potentiel.
The idea would be to integrate the existing web server in mORMot.
See sample 09 for a low-level HTTP server, using "web" as URI root, by which you may be able to redirect to your previous Indy-based code.
Then you can build a mORMot REST SOA server on the very same server, using "rest" as URI root.

Offline

#3 2017-08-04 14:08:43

Bram
Member
Registered: 2017-08-04
Posts: 5

Re: Integrate mORMot in webserver, or the other way around

Hi ab. Thanks for your reply. I would indeed prefer to use the mORMot Webserver for those reasons. I've looked at the sample, but the problem is that we use Webbroker modules in the Indy webserver. We could ditch Indy, if we could use the Webbroker modules with mORMot. Would that be possible somehow?

Offline

#4 2017-08-04 14:52:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Integrate mORMot in webserver, or the other way around

There is no WebBroker support in mORMot, because we found out that WebBroker implementation was bloated for our needs.
We stayed away from WebBroker and those technologies, for better performance and maintainability.

You may be able to implement something like just IdHTTPWebBrokerBridge.pas, but using mORMot HTTP server.
Another possibility may be to call the Indy/WebBroker server running locally, directly from the mORMot server, via HTTP: in practice, it may be fast enough for your purpose - and definitively less difficult to implement!

Offline

#5 2017-08-08 13:30:30

Bram
Member
Registered: 2017-08-04
Posts: 5

Re: Integrate mORMot in webserver, or the other way around

Hi ab. Thanks again. It seems none of the REST solutions we're comparing support Webbroker. We're considering keeping the old Webbroker-server in the background, and using mORMot as a proxy for the web-requests. Do you have any samples or pointers on how to tackle this?

Offline

#6 2017-08-08 14:00:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Integrate mORMot in webserver, or the other way around

My advice may be the following:
- Define a single TSQLRestServer instance for all the process, with its own HTTP server.
- Use a method-based service for the proxy to the local Webbroker server.
- Use interface-based services for new REST endpoints.

Offline

Board footer

Powered by FluxBB