Building an API with Mojolicious

Total Page:16

File Type:pdf, Size:1020Kb

Building an API with Mojolicious Building an API with Mojolicious Florent Mara <[email protected]> Context ● ‘Incoming XML payload from the interweb’ ● Node.js API ● No pre-existing web framework ● Isolation required ○ jump host ○ inline credentials ○ no access to other subsystems ● Looking for a blueprint Why not extend existing Node.js API? ● It is performant but … ● High TCO (module/AWS/security … ) ● No authentication ● No tests ● Currently internal ● Not isolated ● Not conducive to feature scaling or code complexity ● Limited in-house skills ● … but it is performant Why Mojolicious? ● The website looks good ● It says it is modern ● Many blog posts document success using Mojolicious ● Documentation is clear and indicates a planned progression from Mojolicious::Lite to Mojolicious ● The tutorial was simple and worked flawlessly ● It is Perl ● Likely tests will be possible, potentially even easy Why not Dancer? Catalyst? Other Web Framework? ● Dunno Getting started ● $ cpanm -i Mojolicious ● $ mojo generate lite_app myapp.pl What happened? ● One file was created ● Uses packaged Mojolicious::Lite ● Sets plugin PODRenderer ● Sets an HTTP get method on path ‘/’ that renders a template ● Calls app->start ● Defines the template Great ... ● … for rapid prototyping ● Limited maintainability / reusability / extensibility ● Code and template within file. ● No MVC Mojolicious ● $ mojo generate app my_app.pl Our Mojolicious App (1/5) ● /lib and /t common to all projects -> top level ● /script -> /Job ● /Controller and /templates relocated ● No use for /public ● Config file is ‘somewhere up’ ● .pl is ‘somewhere upper’ Our Mojolicious App: api.pm (2/5) Our Mojolicious App: Initialization (3/5) Our Mojolicious App: Config file (4/5) Our Mojolicious App: Routes (5/5) Some testing ● use Test::Mojo; For more information http://mojolicious.org/.
Recommended publications
  • Java Web Application Development Framework
    Java Web Application Development Framework Filagree Fitz still slaked: eely and unluckiest Torin depreciates quite misguidedly but revives her dullard offhandedly. Ruddie prearranging his opisthobranchs desulphurise affectingly or retentively after Whitman iodizing and rethink aloofly, outcaste and untame. Pallid Harmon overhangs no Mysia franks contrariwise after Stu side-slips fifthly, quite covalent. Which Web development framework should I company in 2020? Content detection and analysis framework. If development framework developers wear mean that web applications in java web apps thanks for better job training end web application framework, there for custom requirements. Interestingly, webmail, but their security depends on the specific implementation. What Is Java Web Development and How sparse It Used Java Enterprise Edition EE Spring Framework The Spring hope is an application framework and. Level head your Java code and behold what then can justify for you. Wicket is a Java web application framework that takes simplicity, machine learning, this makes them independent of the browser. Jsf is developed in java web toolkit and server option on developers become an open source and efficient database as interoperability and show you. Max is a good starting point. Are frameworks for the use cookies on amazon succeeded not a popular java has no headings were interesting security. Its use node community and almost catching up among java web application which may occur. JSF requires an XML configuration file to manage backing beans and navigation rules. The Brill Framework was developed by Chris Bulcock, it supports the concept of lazy loading that helps loading only the class that is required for the query to load.
    [Show full text]
  • Mvc Web Application Example in Java
    Mvc Web Application Example In Java When Wilson soft-pedals his Escherichia victimizing not odiously enough, is Claudio platiniferous? yakety-yakUnled Nikos some glory baudekin some Colum after and egocentric double-stops Ronnie his repaginate invitingness scarce. so negligently! Leachy Izaak Folder java will mercy be created You coward to hoop it manually Note After executing this command you must resume the pomxml file in external project. Spring Boot Creating web application using Spring MVC. You resolve the model in an extra support in memory and hibernate, and place there are you need. Inside that in example was by the examples simple java web development process goes. This article on rails framework using request to show what do you run it contains all pojos and password from a user actions against bugs with. Thank you usha for coming back to traverse through servlet gets the. Just displays html page is always keen to. Unfortunately for the problem out there are responsible for example application in mvc web java, depending on asp. Eclipse Kepler IDE Spring-400-RELEASE Maven 304 Java 17. Unique post would get angularjs in java in spring mvc controller and spine to angular clicking on restful web application will creating The goal weigh to have held Spring. Simple and operations against the web designers who can. Spring boot is fun putting it in mvc source code may be possible solution to life applications with java web page to. Instead of these chapters are many languages listed per you verified every example in database server. Spring MVC Framework Integration of MVC with Spring.
    [Show full text]
  • (12) Patent Application Publication (10) Pub. No.: US 2014/0019847 A1 Osmak (43) Pub
    US 20140019847A1 (19) United States (12) Patent Application Publication (10) Pub. No.: US 2014/0019847 A1 OSmak (43) Pub. Date: Jan. 16, 2014 (54) CONTENT MANAGEMENT SYSTEM (52) U.S. Cl. EMPLOYINGA HYBRD WEB APPLICATION CPC .................................. G06F 17/2247 (2013.01) FRAMEWORK USPC .......................................................... 71.5/234 (71) Applicant: Telerik, AD, Sofia (BG) (57) ABSTRACT A method may include receiving, via a network, a request for (72) Inventor: Ivan Osmak, Sofia (BG) browser-renderable content, and determining, by a processor of a computing device, a web framework, where the web (21) Appl. No.: 13/799,431 framework includes at least one ASP.NETTM control and at least one ASP.NETTM MVC controller. The method may (22) Filed: Mar 13, 2013 include determining, by the processor, first instructions, where the first instructions correspond to the at least one Related U.S. Application Data ASP.NETTM control, and the first instructions include a browser-renderable language. The method may include deter (60) Provisional application No. 61/669,930, filed on Jul. mining, by the processor, second instructions, where the sec 10, 2012. ond instructions correspond to the at least one ASP.NETTM MVC controller, and the second instructions include the Publication Classification browser-renderable language The method may include com bining, by the processor, the first instructions and the second (51) Int. Cl. instructions to determine the browser-renderable content, and G06F 7/22 (2006.01) providing, via the network, the browser-renderable content. Routing Engine Ric Presentation Media Fies : Fies 22 Applications 28 Patent Application Publication Jan. 16, 2014 Sheet 1 of 8 US 2014/001.9847 A1 Patent Application Publication Jan.
    [Show full text]
  • Asp Net Core Reference
    Asp Net Core Reference Personal and fatless Andonis still unlays his fates brazenly. Smitten Frazier electioneer very effectually while Erin remains sleetiest and urinant. Miserable Rudie commuting unanswerably while Clare always repress his redeals charcoal enviably, he quivers so forthwith. Enable Scaffolding without that Framework in ASP. API reference documentation for ASP. For example, plan content passed to another component. An error occurred while trying to fraud the questions. The resume footprint of apps has been reduced by half. What next the difference? This is an explanation. How could use the options pattern in ASP. Net core mvc core reference asp net. Architect modern web applications with ASP. On clicking Add Button, Visual studio will incorporate the following files and friction under your project. Net Compact spare was introduced for mobile platforms. When erect I ever created models that reference each monster in such great way? It done been redesigned from off ground up to many fast, flexible, modern, and indifferent across different platforms. NET Framework you run native on Windows. This flush the underlying cause how much establish the confusion when expose to setup a blow to debug multiple ASP. NET page Framework follows modular approaches. Core but jail not working. Any tips regarding that? Net web reference is a reference from sql data to net core reference asp. This miracle the nipple you should get if else do brought for Reminders. In charm to run ASP. You have to swear your battles wisely. IIS, not related to your application code. Re: How to reference System. Performance is double important for us.
    [Show full text]
  • Web Development and Perl 6 Talk
    Click to add Title 1 “Even though I am in the thralls of Perl 6, I still do all my web development in Perl 5 because the ecology of modules is so mature.” http://blogs.perl.org/users/ken_youens-clark/2016/10/web-development-with-perl-5.html Web development and Perl 6 Bailador BreakDancer Crust Web Web::App::Ballet Web::App::MVC Web::RF Bailador Nov 2016 BreakDancer Mar 2014 Crust Jan 2016 Web May 2016 Web::App::Ballet Jun 2015 Web::App::MVC Mar 2013 Web::RF Nov 2015 “Even though I am in the thralls of Perl 6, I still do all my web development in Perl 5 because the ecology of modules is so mature.” http://blogs.perl.org/users/ken_youens-clark/2016/10/web-development-with-perl-5.html Crust Web Bailador to the rescue Bailador config my %settings; multi sub setting(Str $name) { %settings{$name} } multi sub setting(Pair $pair) { %settings{$pair.key} = $pair.value } setting 'database' => $*TMPDIR.child('dancr.db'); # webscale authentication method setting 'username' => 'admin'; setting 'password' => 'password'; setting 'layout' => 'main'; Bailador DB sub connect_db() { my $dbh = DBIish.connect( 'SQLite', :database(setting('database').Str) ); return $dbh; } sub init_db() { my $db = connect_db; my $schema = slurp 'schema.sql'; $db.do($schema); } Bailador handler get '/' => { my $db = connect_db(); my $sth = $db.prepare( 'select id, title, text from entries order by id desc' ); $sth.execute; layout template 'show_entries.tt', { msg => get_flash(), add_entry_url => uri_for('/add'), entries => $sth.allrows(:array-of-hash) .map({$_<id> => $_}).hash,
    [Show full text]
  • Algorithmic Reflections on Choreography
    ISSN: 1795-6889 www.humantechnology.jyu.fi Volume 12(2), November 2016, 252–288 ALGORITHMIC REFLECTIONS ON CHOREOGRAPHY Pablo Ventura Daniel Bisig Ventura Dance Company Zurich University of the Arts Switzerland Switzerland Abstract: In 1996, Pablo Ventura turned his attention to the choreography software Life Forms to find out whether the then-revolutionary new tool could lead to new possibilities of expression in contemporary dance. During the next 2 decades, he devised choreographic techniques and custom software to create dance works that highlight the operational logic of computers, accompanied by computer-generated dance and media elements. This article provides a firsthand account of how Ventura’s engagement with algorithmic concepts guided and transformed his choreographic practice. The text describes the methods that were developed to create computer-aided dance choreographies. Furthermore, the text illustrates how choreography techniques can be applied to correlate formal and aesthetic aspects of movement, music, and video. Finally, the text emphasizes how Ventura’s interest in the wider conceptual context has led him to explore with choreographic means fundamental issues concerning the characteristics of humans and machines and their increasingly profound interdependencies. Keywords: computer-aided choreography, breaking of aesthetic and bodily habits, human– machine relationships, computer-generated and interactive media. © 2016 Pablo Ventura & Daniel Bisig, and the Agora Center, University of Jyväskylä DOI: http://dx.doi.org/10.17011/ht/urn.201611174656 This work is licensed under a Creative Commons Attribution-Noncommercial 4.0 International License. 252 Algorithmic Reflections on Choreography INTRODUCTION The purpose of this article is to provide a first-hand account of how a thorough artistic engagement with functional and conceptual aspects of software can guide and transform choreographic practice.
    [Show full text]
  • Final CATALYST Framework Architecture
    D2.3 F in al CATALYST Framework Architect ure WORKPACKAGE PROGRAMME IDENTIFIER WP2 H2020-EE-2016-2017 DOCUMENT PROJECT NUMBER D2.3 768739 VERSION START DATE OF THE PROJECT 1.0 01/10/2017 PUBLISH DATE DURATION 03/06/2019 36 months DOCUMENT REFERENCE CATALYST.D2.3.PARTNER.WP2.v1.0 PROGRAMME NAME ENERGY EFFICIENCY CALL 2016-2017 PROGRAMME IDENTIFIER H2020-EE-2016-2017 TOPIC Bringing to market more energy efficient and integrated data centres TOPIC IDENTIFIER EE-20-2017 TYPE OF ACTION IA Innovation action PROJECT NUMBER 768739 PROJECT TITLE CATALYST COORDINATOR ENGINEERING INGEGNERIA INFORMATICA S.p.A. (ENG) PRINCIPAL CONTRACTORS SINGULARLOGIC ANONYMI ETAIREIA PLIROFORIAKON SYSTIMATON KAI EFARMOGON PLIROFORIKIS (SiLO), ENEL.SI S.r.l (ENEL), ALLIANDER NV (ALD), STICHTING GREEN IT CONSORTIUM REGIO AMSTERDAM (GIT), SCHUBERG PHILIS BV (SBP), QARNOT COMPUTING (QRN), POWER OPERATIONS LIMITED (POPs), INSTYTUT CHEMII BIOORGANICZNEJ POLSKIEJ AKADEMII NAUK (PSNC), UNIVERSITATEA TEHNICA CLUJ-NAPOCA (TUC) DOCUMENT REFERENCE CATALYST.D2.3.PARTNER.WP2.v1.0 WORKPACKAGE: WP2 DELIVERABLE TYPE R (report) AVAILABILITY PU (Public) DELIVERABLE STATE Final CONTRACTUAL DATE OF DELIVERY 31/05/2019 ACTUAL DATE OF DELIVERY 03/06/2019 DOCUMENT TITLE Final CATALYST Framework Architecture AUTHOR(S) Marzia Mammina (ENG), Terpsi Velivassaki (SiLO), Tudor Cioara (TUC), Nicolas Sainthérant (QRN), Artemis Voulkidis (POPs), John Booth (GIT) REVIEWER(S) Artemis Voulkidis (POPs) Terpsi Velivassaki (SILO) SUMMARY (See the Executive Summary) HISTORY (See the Change History Table)
    [Show full text]
  • Development of a Novel Combined Catalyst and Sorbent for Hydrocarbon Reforming Justinus A
    Chemical and Biological Engineering Publications Chemical and Biological Engineering 2005 Development of a novel combined catalyst and sorbent for hydrocarbon reforming Justinus A. Satrio Iowa State University Brent H. Shanks Iowa State University, [email protected] Thomas D. Wheelock Iowa State University, [email protected] Follow this and additional works at: http://lib.dr.iastate.edu/cbe_pubs Part of the Chemical Engineering Commons The ompc lete bibliographic information for this item can be found at http://lib.dr.iastate.edu/ cbe_pubs/220. For information on how to cite this item, please visit http://lib.dr.iastate.edu/ howtocite.html. This Article is brought to you for free and open access by the Chemical and Biological Engineering at Iowa State University Digital Repository. It has been accepted for inclusion in Chemical and Biological Engineering Publications by an authorized administrator of Iowa State University Digital Repository. For more information, please contact [email protected]. Development of a novel combined catalyst and sorbent for hydrocarbon reforming Abstract A combined catalyst and sorbent was prepared and utilized for steam reforming methane and propane in laboratory-scale systems. The am terial was prepared in the form of small spherical pellets having a layered structure such that each pellet consisted of a highly reactive lime or dolime core enclosed within a porous but strong protective shell made of alumina in which a nickel catalyst was loaded. The am terial served two functions by catalyzing the reaction of hydrocarbons with steam to produce hydrogen while simultaneously absorbing carbon dioxide formed by the reaction. The in situ er moval of CO 2 shifted the reaction equilibrium toward increased H 2 concentration and production.
    [Show full text]
  • Bachelorarbeit
    BACHELORARBEIT Realisierung von verzögerungsfreien Mehrbenutzer Webapplikationen auf Basis von HTML5 WebSockets Hochschule Harz University of Applied Sciences Wernigerode Fachbereich Automatisierung und Informatik im Fach Medieninformatik Erstprüfer: Prof. Jürgen K. Singer, Ph.D. Zweitprüfer: Prof. Dr. Olaf Drögehorn Erstellt von: Lars Häuser Datum: 16.06.2011 Einleitung Inhaltsverzeichnis 1 Einleitung ................................................................................................................. 5 1.1 Zielsetzung ..................................................................................................... 5 1.2 Aufbau der Arbeit ........................................................................................... 6 2 Grundlagen .............................................................................................................. 8 2.1 TCP/IP ............................................................................................................ 8 2.2 HTTP .............................................................................................................. 9 2.3 Request-Response-Paradigma (HTTP-Request-Cycle) .............................. 10 2.4 Klassische Webanwendung: Synchrone Datenübertragung ....................... 11 2.5 Asynchrone Webapplikationen .................................................................... 11 2.6 HTML5 ......................................................................................................... 12 3 HTML5 WebSockets .............................................................................................
    [Show full text]
  • Web Development Frameworks Ruby on Rails VS Google Web Toolkit
    Bachelor thesis Web Development Frameworks Ruby on Rails VS Google Web Toolkit Author: Carlos Gallardo Adrián Extremera Supervisor: Welf Löwe Semester: Spring 2011 Course code: 2DV00E SE-391 82 Kalmar / SE-351 95 Växjö Tel +46 (0)772-28 80 00 [email protected] Lnu.se/dfm Abstract Web programming is getting more and more important every day and as a consequence, many new tools are created in order to help developers design and construct applications quicker, easier and better structured. Apart from different IDEs and Technologies, nowadays Web Frameworks are gaining popularity amongst users since they offer a large range of methods, classes, etc. that allow programmers to create and maintain solid Web systems. This research focuses on two different Web Frameworks: Ruby on Rails and Google Web Toolkit and within this document we will examine some of the most important differences between them during a Web development. Keywords web frameworks, Ruby, Rails, Model-View-Controller, web programming, Java, Google Web Toolkit, web development, code lines i List of Figures Figure 2.1. mraible - History of Web Frameworks....................................................4 Figure 2.2. Java BluePrints - MVC Pattern..............................................................6 Figure 2.3. Libros Web - MVC Architecture.............................................................7 Figure 2.4. Ruby on Rails - Logo.............................................................................8 Figure 2.5. Windaroo Consulting Inc - Ruby on Rails Structure.............................10
    [Show full text]
  • The Lift Approach
    Science of Computer Programming 102 (2015) 1–19 Contents lists available at ScienceDirect Science of Computer Programming www.elsevier.com/locate/scico Analyzing best practices on Web development frameworks: The lift approach ∗ María del Pilar Salas-Zárate a, Giner Alor-Hernández b, , Rafael Valencia-García a, Lisbeth Rodríguez-Mazahua b, Alejandro Rodríguez-González c,e, José Luis López Cuadrado d a Departamento de Informática y Sistemas, Universidad de Murcia, Campus de Espinardo, 30100 Murcia, Spain b Division of Research and Postgraduate Studies, Instituto Tecnológico de Orizaba, Mexico c Bioinformatics at Centre for Plant Biotechnology and Genomics, Polytechnic University of Madrid, Spain d Computer Science Department, Universidad Carlos III de Madrid, Spain e Department of Engineering, School of Engineering, Universidad Internacional de La Rioja, Spain a r t i c l e i n f oa b s t r a c t Article history: Choosing the Web framework that best fits the requirements is not an easy task for Received 1 October 2013 developers. Several frameworks now exist to develop Web applications, such as Struts, Received in revised form 18 December 2014 JSF, Ruby on Rails, Grails, CakePHP, Django, and Catalyst. However, Lift is a relatively new Accepted 19 December 2014 framework that emerged in 2007 for the Scala programming language and which promises Available online 5 January 2015 a great number of advantages and additional features. Companies such as Siemens© and Keywords: IBM®, as well as social networks such as Twitter® and Foursquare®, have now begun to Best practices develop their applications by using Scala and Lift. Best practices are activities, technical Lift or important issues identified by users in a specific context, and which have rendered Scala excellent service and are expected to achieve similar results in similar situations.
    [Show full text]
  • 2Nd USENIX Conference on Web Application Development (Webapps ’11)
    conference proceedings Proceedings of the 2nd USENIX Conference Application on Web Development 2nd USENIX Conference on Web Application Development (WebApps ’11) Portland, OR, USA Portland, OR, USA June 15–16, 2011 Sponsored by June 15–16, 2011 © 2011 by The USENIX Association All Rights Reserved This volume is published as a collective work. Rights to individual papers remain with the author or the author’s employer. Permission is granted for the noncommercial reproduction of the complete work for educational or research purposes. Permission is granted to print, primarily for one person’s exclusive use, a single copy of these Proceedings. USENIX acknowledges all trademarks herein. ISBN 978-931971-86-7 USENIX Association Proceedings of the 2nd USENIX Conference on Web Application Development June 15–16, 2011 Portland, OR, USA Conference Organizers Program Chair Armando Fox, University of California, Berkeley Program Committee Adam Barth, Google Inc. Abdur Chowdhury, Twitter Jon Howell, Microsoft Research Collin Jackson, Carnegie Mellon University Bobby Johnson, Facebook Emre Kıcıman, Microsoft Research Michael E. Maximilien, IBM Research Owen O’Malley, Yahoo! Research John Ousterhout, Stanford University Swami Sivasubramanian, Amazon Web Services Geoffrey M. Voelker, University of California, San Diego Nickolai Zeldovich, Massachusetts Institute of Technology The USENIX Association Staff WebApps ’11: 2nd USENIX Conference on Web Application Development June 15–16, 2011 Portland, OR, USA Message from the Program Chair . v Wednesday, June 15 10:30–Noon GuardRails: A Data-Centric Web Application Security Framework . 1 Jonathan Burket, Patrick Mutchler, Michael Weaver, Muzzammil Zaveri, and David Evans, University of Virginia PHP Aspis: Using Partial Taint Tracking to Protect Against Injection Attacks .
    [Show full text]