Coder Social home page Coder Social logo

sarkartanzil / mojo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mojolicious/mojo

0.0 1.0 0.0 23.16 MB

:sparkles: Mojolicious - Perl real-time web framework

Home Page: http://mojolicious.org

License: Artistic License 2.0

Batchfile 0.10% Perl 99.89% Mathematica 0.01% XProc 0.01%

mojo's Introduction

Mojolicious Build Status Windows build status

Back in the early days of the web, many people learned Perl because of a wonderful Perl library called CGI. It was simple enough to get started without knowing much about the language and powerful enough to keep you going, learning by doing was much fun. While most of the techniques used are outdated now, the idea behind it is not. Mojolicious is a new endeavor to implement this idea using bleeding edge technologies.

Features

  • An amazing real-time web framework, allowing you to easily grow single file prototypes into well-structured MVC web applications.
    • Powerful out of the box with RESTful routes, plugins, commands, Perl-ish templates, content negotiation, session management, form validation, testing framework, static file server, CGI/PSGI detection, first class Unicode support and much more for you to discover.
  • A powerful web development toolkit, that you can use for all kinds of applications, independently of the web framework.
    • Full stack HTTP and WebSocket client/server implementation with IPv6, TLS, SNI, IDNA, HTTP/SOCKS5 proxy, UNIX domain socket, Comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, and gzip compression support.
    • Built-in non-blocking I/O web server, supporting multiple event loops as well as optional pre-forking and hot deployment, perfect for building highly scalable web services.
    • JSON and HTML/XML parser with CSS selector support.
  • Very clean, portable and object-oriented pure-Perl API with no hidden magic and no requirements besides Perl 5.22.0 (versions as old as 5.10.1 can be used too, but may require additional CPAN modules to be installed)
  • Fresh code based upon years of experience developing Catalyst, free and open source.

Installation

All you need is a one-liner, it takes less than a minute.

$ curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious

We recommend the use of a Perlbrew environment.

Getting Started

These three lines are a whole web application.

use Mojolicious::Lite;

get '/' => {text => 'I ♥ Mojolicious!'};

app->start;

To run this example with the built-in development web server just put the code into a file and start it with morbo.

$ morbo hello.pl
Server available at http://127.0.0.1:3000

$ curl http://127.0.0.1:3000/
I ♥ Mojolicious!

Duct tape for the HTML5 web

Use all the latest Perl and HTML features in beautiful single file prototypes like this one, and grow them easily into well-structured applications.

use Mojolicious::Lite;
use 5.20.0;
use experimental 'signatures';

# Render template "index.html.ep" from the DATA section
get '/' => {template => 'index'};

# WebSocket service used by the template to extract the title from a website
websocket '/title' => sub ($c) {
  $c->on(message => sub ($c, $msg) {
    my $title = $c->ua->get($msg)->result->dom->at('title')->text;
    $c->send($title);
  });
};

app->start;
__DATA__

@@ index.html.ep
% my $url = url_for 'title';
<script>
  var ws = new WebSocket('<%= $url->to_abs %>');
  ws.onmessage = function (event) { document.body.innerHTML += event.data };
  ws.onopen    = function (event) { ws.send('http://mojolicious.org') };
</script>

Want to know more?

Take a look at our excellent documentation!

mojo's People

Contributors

abh avatar acajou avatar afresh1 avatar akron avatar alexvaluyskiy avatar amenonsen avatar avkhozov avatar bfaist avatar charsbar avatar chromatic avatar dsteinbrunner avatar gbarr avatar grinnz avatar jamadam avatar jberger avatar kraih avatar lindleyw avatar marcusramberg avatar markstos avatar melo avatar memowe avatar mvuets avatar niczero avatar olegwtf avatar rsp avatar tempire avatar wttw avatar yko avatar yuki-kimoto avatar zoffixznet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.