Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
moltar committed May 1, 2016
0 parents commit 4f0938b
Show file tree
Hide file tree
Showing 18 changed files with 3,421 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local/
1 change: 1 addition & 0 deletions .perl-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.22.1
10 changes: 10 additions & 0 deletions .travis.yml
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/
4 changes: 4 additions & 0 deletions Changes
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
25 changes: 25 additions & 0 deletions Makefile.PL
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;
27 changes: 27 additions & 0 deletions README.md
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
```
20 changes: 20 additions & 0 deletions app.psgi
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;
};
14 changes: 14 additions & 0 deletions cpanfile
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';
};
Loading

0 comments on commit 4f0938b

Please sign in to comment.