Which MVC framework in Perl has its own standalone server? - django

I am creating an automated testing framework in Perl for regression tests. I would like to post my results from the test machines. I have used django before where the server ran standalone with no installation needed. Which MVC framework in Perl has its own standalone server? Basically, which of the Perl MVC frameworks is closest to django's server capability and DRY (Don't Repeat Yourself) principles?
P.S. I will not rewrite my framework in python
P.S.S I will not use Perl framework and django as MVC
(no python on servers :( )

Catalyst comes with a built-in test server - check Catalyst::Manual::Tutorial for more details. This looks like a good place to start.

Every popular Perl web framework comes with it's own server: Catalyst, CGI::Application, Jifty. Most popular and DRY-following is Catalyst (don't know about DRY in Jifty).
Also there test result aggregators like Smolder.

Catalyst comes with it's own server script/myapp_server.pl. You can also deploy with our without a reverse proxy using the built in server, but in this case it's advisable to use Catalyst::Engine::HTTP::Prefork: CATALYST_ENGINE='HTTP::Prefork' script/myapp_server.pl
I believe Jifty also has a built in dev server, as does Squatting, but I haven't used either of them.

Maybe Catalyst.
I don't know if it has a stand alone server, but it's Perl with MVC,

Related

Python Web Frameworks For Production Level

I have been using Flask for Building REST API on the development level. I want to create REST API at Production Level. So which Python web framework would be Best?
These frameworks I saw while searching:
CherryPy
Flask
Django
Pyramid
TurboGears
Pylons
Web2py
Falcon
Bottle
Etc.
Django has a big support for REST API. According to my own experience I'd advice Django.
See more here: https://www.django-rest-framework.org/
For a REST API, I would use FastAPI. It has a strong reputation.
I have used it for several projects, and I like it because it fairly easily lets you do the right thing without much work. For instance, it relies upon pedantic to ensure the proper data types for what you are sending/receiving.

Best pratice for testing REST interfaces

I'm writing a REST-full webapp and I'm looking for a good testing framework. The app is mostly writen in Erlang, but I would like to test the front-end of the app without relying on the erlang code.
Also integration with a js testframework would be desireable.
Good day, if you have minimal ruby knowledge, then i would recommend you use capybara+rails solution, it also allows testing javascript-rich sites, just use javascript-enabled test driver like selenium, here is short doc about using it with remote sites: http://rubydoc.info/github/jnicklas/capybara/master#Calling_remote_servers
Also check out cucumber http://cukes.info/ which plays well with rails+capybara combo and also has erlang port

Using C++/Qt4 application as backend for web application

for one of my applications I'd like to provide a minimal web interface. This core application is written in C++ and uses Qt4 as a framework. Since I'm also using some libraries I wrote to calculate some things and do some complex data management, I'd like to use this existing code as a backend to the web interface.
Idea 1: Using an embedded web server
The first thing I tried (and which worked to some degree) was using an embedded web server (mongoose). As you can imagine, it is just a very thin library and you have to implement a lot of things yourself (like session management, cookies, etc.).
Idea 2: Using a normal web server and adding a fcgi/cgi/scgi backend to my application
The next thing that came to my head was using a mature but compact web server (for instance, lighttpd) and simple provide a fcgi/scgi/cgi backend to it. I could write the web application using a good framework, like Pylons, PHP, or RoR, (...) and simply have an URL prefix, like /a/... which allows me to directly talk to the backend.
I tried to implement the libfcgi into my application, but it looks messier than needed (for instance you'd have to implement your own TCP/IP sockets to pass on data between your app and the web server and tunnel it through the FCGI library, meh)
Idea 3: Creating a command line version of my application which does the most basic things and use a normal web server and framework to do the rest
This is the third idea that came to my head. It is basically about creating a web application using a traditional way (PHP, RoR, etc.) and using a command line version of my application to process data and return it when needed.
I've got some experience with creating web applications, but I never had to do something like this, so I'd like to hear some ideas or suggestions. I'd like to use JavaScript on the browsers (AJAX, that is) and pass some JSON constructs between web browser and server to make the user experience a bit smoother.
So what are your suggestions, ideas on this? I don't want to re-invent the wheel, honestly.
I would never expose a custom written application to the net as front-end, for that servers like apache or lighthttp are build. They give you some serious security out of the box.
As for interaction of your app with that webserver, it depends a bit on the load and what kind of experience you have with writing software in PHP, python or other languages supported by your web server (via interpreter of course).
A slight load, and a command line tool accessed from PHP might do perfectly well.
A more heavy load and you might wish to implement a simple (SOAP?) server with Qt and access that from a python (or php) script.
That way you don't need to do layout in you app, and you also don't need to implement security all that much.
I'm currently researching a similar situation (custom web app backend using Qt), and the least bad option is FastCGI. Found something you might be interested in. Not production ready without some serious testing, but this might be a good starting point for Qt - FastCGI interop: FastCGIQt
I've used the FastCGI Protocol Driver library for a similar project (also a Qt application), the download link is at the end of that page [Libfastcgi]. Integration with the application turned out actually comparatively easy. Lighttpd + mod_fastcgi was used as web server. Can't say anything about FastCGIQt, though.
You Wt works well to provide a web interface to Qt based applications. Both have a similar programming style, and there's an example that demonstrates the integration with Qt.
Here is example of embedded QML-server: https://github.com/ncp1402/ql-server

Compare GWT and Django?

both seems to be pretty cool
which is to be in used in what scenario ?
GWT: http://code.google.com/webtoolkit/
Faster AJAX than you'd write by hand
With Google Web Toolkit (GWT), you
write your AJAX front-end in the Java
programming language which GWT then
cross-compiles into optimized
JavaScript that automatically works
across all major browsers.
Django: http://www.djangoproject.com/
a high-level Python Web framework that
encourages rapid development and
clean, pragmatic design.
They have little or nothing to do with each other. Django provides some Javascript; Django can easily handle the server-side of any Ajax conversation.
Django doesn't help you write javascript. It helps you write the server-side of the application.
Django helps you write the HTML pagess (with templates). If the page includes, or relies on Javascript, Django doesn't care very much at all.
pyjamas is a Python port of the GWT, so all the javascript is generated using Python instead of Java.
If you're planning on working with Django it might simplify to make your entire shop code in Python.
It is quite possible to use both in the same project. I've been working on such a project for some time now. Have Django handle the server side and leave the client side to GWT. The only issue I have is that the RPC mechanism in GWT cannot be used because it works with Java servlets. I use JSON for communication instead.
With GWT you write client-side applications, that run inside some browser Javascript engine. You code in Java, and it gets compiled into Javascript.
Django, is different because you write server-side applications: applications will be executed in the server and their result is sent to the client browser. Ah! Django is Python.
Both have libraries to achieve most of the tasks web developer needs, like internationalization, sessions, etc. Django comes with a nice ORM (Object Relational Mapper) and GWT comes with a Tomcat based engine, for the server-side coding and development.
If you need to make a decision just choose the framework based in the language of your choice.
I use xml serialization for communication between django and gwt
http://www.eecho.info/Echo/ajax/requestbuilder-gwt-15/

Test framework for web services

We have a monolithic application written in Visual Dataflex, and various complementing applications written in other (.NET) languages. They all share the same database, and need to follow the same business logic. One way to facilitate unified business logic across these is to provide web services as an interface for testing.
Of course, for this to work, we need a good framework for testing web services. Any suggestions? For example, can Cucumber do this "out of the box"?
I'm assuming you're talking about Soap web services. You can use Soap4R to talk to a Soap web service. Wrapping this all up in Cucumber scenarios should work fine.
SoapUI is a pretty nice product for creating webservice tests, and they're easily callable via junit or just via the command line. It's also got some stuff for creating load tests as well.
They've got an opensource version as well as a professional version.