-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4f0938b
Showing
18 changed files
with
3,421 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
local/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5.22.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
language: perl | ||
perl: | ||
- "5.16" | ||
- "5.22" | ||
before_install: | ||
- cpanm Carton | ||
install: | ||
- carton install | ||
script: | ||
- carton exec -- prove -lrv t/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This file documents the revision history for Perl extension Todo::Backend. | ||
|
||
0.01 2016-04-29 16:26:40 | ||
- initial revision, generated by Catalyst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env perl | ||
# IMPORTANT: if you delete this file your app will not work as | ||
# expected. You have been warned. | ||
use inc::Module::Install 1.02; | ||
use Module::Install::Catalyst; # Complain loudly if you don't have | ||
# Catalyst::Devel installed or haven't said | ||
# 'make dist' to create a standalone tarball. | ||
|
||
name 'Todo-Backend'; | ||
all_from 'lib/Todo/Backend.pm'; | ||
|
||
requires 'Catalyst::Runtime' => '5.90104'; | ||
requires 'Catalyst::Plugin::ConfigLoader'; | ||
requires 'Catalyst::Plugin::Static::Simple'; | ||
requires 'Catalyst::Action::RenderView'; | ||
requires 'Moose'; | ||
requires 'namespace::autoclean'; | ||
requires 'Config::General'; # This should reflect the config file format you've chosen | ||
# See Catalyst::Plugin::ConfigLoader for supported formats | ||
test_requires 'Test::More' => '0.88'; | ||
catalyst; | ||
|
||
install_script glob('script/*.pl'); | ||
auto_install; | ||
WriteAll; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Todo Backend - Perl [Catalyst](https://metacpan.org/pod/Catalyst) Implementation | ||
|
||
[![Build Status](https://travis-ci.org/moltar/todo-backend-catalyst.png?branch=master)](https://travis-ci.org/moltar/todo-backend-catalyst) | ||
|
||
This is a very basic Catalyst implementation of the [TODO backend](http://www.todobackend.com/). | ||
|
||
One interesting module is the [Plack::Middleware::CrossOrigin](https://metacpan.org/pod/Plack::Middleware::CrossOrigin) but everything else is relatively standard. | ||
|
||
Feel free to submit pull requests to improve this. | ||
|
||
[Run live test on todobackend.com](http://www.todobackend.com/specs/index.html?https://todo-backend-catalyst.herokuapp.com/) | ||
|
||
## Heroku | ||
|
||
This repo is Heroku-ready via [Heroku buildpack: Perl](https://github.com/miyagawa/heroku-buildpack-perl.git). | ||
Follow the instructions on the repo to launch it. | ||
|
||
Live demo can be found here: [https://todo-backend-catalyst.herokuapp.com/](https://todo-backend-catalyst.herokuapp.com/). | ||
|
||
## Carton | ||
|
||
To get started locally, you can use [Carton](https://metacpan.org/pod/Carton) to install the dependencies. | ||
|
||
```sh | ||
carton install --deployment | ||
carton exec -- plackup -I lib app.psgi | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use lib './lib'; | ||
use Todo::Backend; | ||
use Plack::Builder; | ||
use Plack::Middleware::CrossOrigin; | ||
|
||
my $app = Todo::Backend->apply_default_middlewares( Todo::Backend->psgi_app ); | ||
|
||
builder { | ||
enable_if { $_[0]->{HTTP_X_FORWARDED_FOR} } 'ReverseProxy'; | ||
|
||
enable 'CrossOrigin', | ||
origins => '*', | ||
methods => '*', | ||
headers => ['Content-Type']; | ||
|
||
$app; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
requires 'Catalyst::Action::RenderView'; | ||
requires 'Catalyst::Model::Adaptor'; | ||
requires 'Catalyst::Plugin::ConfigLoader'; | ||
requires 'Catalyst::Runtime'; | ||
requires 'Catalyst::View::JSON'; | ||
requires 'Config::General'; | ||
requires 'DBM::Deep'; | ||
requires 'Plack::Middleware::CrossOrigin'; | ||
requires 'UUID::Tiny'; | ||
|
||
on 'develop' => sub { | ||
requires 'Catalyst::Devel'; | ||
requires 'Term::Size::Any'; | ||
}; |
Oops, something went wrong.