From 0a5701c5fb6ac4d3ba9ce92ca177ed9da960d053 Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Thu, 16 Jun 2016 00:25:20 -0400 Subject: [PATCH] Moving to mojolite and proxying it --- app.pl | 121 ++++++++++++++++++++++++++++++++ index.html => static/index.html | 0 2 files changed, 121 insertions(+) create mode 100755 app.pl rename index.html => static/index.html (100%) diff --git a/app.pl b/app.pl new file mode 100755 index 0000000..999abf2 --- /dev/null +++ b/app.pl @@ -0,0 +1,121 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use FindBin qw($Bin); +use lib "$Bin/lib"; +use Data::Dumper; + +use Mojolicious::Lite; + +get '/' => sub { + my $c = shift; + $c->render(text => "Make a new paste"); +}; + +get '/pastebin' => sub { + my $c = shift; + $c->redirect_to('/'); +}; + +get '/pastebin/:pasteid' => sub { + my $c = shift; + my $pasteid = $c->param('pasteid'); + $c->stash({pasteid => $pasteid}); + + $c->render(template => "editor"); +}; + +app->start; + +__DATA__ + +@@ editor.html.ep + + + + + + + + + + + + + + + + + Editor + + + + +
+
+
+

Editor

+
+
+
+
+ +
+    
+
+ +
+
+ + + + + + diff --git a/index.html b/static/index.html similarity index 100% rename from index.html rename to static/index.html