Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cside/enigma
Amon2::Lite-based framework for API server
https://github.com/cside/enigma
Last synced: 8 days ago
JSON representation
Amon2::Lite-based framework for API server
- Host: GitHub
- URL: https://github.com/cside/enigma
- Owner: Cside
- License: other
- Created: 2017-02-18T16:04:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T09:01:01.000Z (almost 8 years ago)
- Last Synced: 2024-10-28T16:34:06.140Z (about 2 months ago)
- Language: Perl
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Enigma - Amon2::Lite-based framework for API server
# SYNOPSIS
use Enigma;
get '/' => sub {
my ($c) = @_;
$c->render_json({ message => 'OK' });
};
put '/' => sub {
my ($c) = @_;
$c->validate(
foo => 'Str',
bar => { isa => 'Int', optional => 1 },
) or return $c->error_res;
...
$c->render_json_with_code(201, { message => 'created' });
};
__PACKAGE__->to_app;# FUNCTIONS
- `get $path, $code;`
- `post $path, $code;`
- `put $path, $code;`
- `patch $path, $code;`
- `del $path, $code;`
- `head $path, $code;`
- `options $path, $code;`
- `$c->render_json($hashref_or_arrayref);`
- `$c->render_json_with_code($status_code, $hashref_or_arrayref);`# LICENSE
Copyright (C) Hiroki Honda.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
Hiroki Honda