Create a web server using C++ Rest Casablanca

Mar 11, 2014 at 9:29 AM
Hi,

How do I make a web server on cloud using C++ Rest Casablanca??
Mar 11, 2014 at 5:41 PM
Hi vrindagoyal,

Casablanca right now provides a library only HTTP server solution. This means you will have to handle any deployment and hosting in say Azure for example by yourself. If you are considering using Azure one option you can explore is creating your server with our http_listener as an executable. Then you can deploy to Azure in a WorkerRole. Take a look at the WorkerRole schema, in particular ProgramEntryPoint.

We have feature request open for Azure support that you can vote on if this scenario is important to you.

Thanks,
Steve
Mar 12, 2014 at 4:42 AM
Edited Mar 12, 2014 at 8:26 AM
Hi Steve,

I have already implemented a server on azure in a WebRole and I am accessing it with client in Cpp REST, I wanted to know if it is possible to deploy server in Cpp to Azure???

Thanks.
Mar 13, 2014 at 2:50 AM
Hi vrindagoyal,

Yes definitely is possible to deploy C++ code to Azure. Like I mentioned in my previous post it could be done using an native C++ executable in a WorkerRole with an open port. To do so with a WebRole would require integrating with IIS. IIS supports native modules, which could be used, however this is not trivial to do. Casablanca is currently a library only solution so you don't get anything out of the box right now for deploying to Azure.

Steve
Mar 14, 2014 at 7:45 AM
Hi Steve,

Can you tell me some tutorial where I can get step-wise procedure to do this?

Thanks,
Vrinda
Mar 15, 2014 at 1:13 AM
Hi Vrinda,

There are several tutorials out there on how to use a native C++ code dll and invoke is APIs from a C# WebRole. Take a look at this one here.

To actually use native code in a WebRole you will have to implement a native module. We have experimented with this a bit, but don't have a full solution that we are ready to support and share. Here is some information on how to implement an IIS native module.

Using a native executable in a WorkerRole is easier. You basically just need to deploy and use the ProgramEntryPoint schema I mentioned earlier in this discussion. In general we don't have a step by step tutorial for this that I can give you. It isn't something that I can just put together quickly.

Thanks,
Steve