Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pigmej/exelli
Elli elixir wrapper with some sugar sytnax goodies.
https://github.com/pigmej/exelli
Last synced: about 2 months ago
JSON representation
Elli elixir wrapper with some sugar sytnax goodies.
- Host: GitHub
- URL: https://github.com/pigmej/exelli
- Owner: pigmej
- License: other
- Created: 2015-06-11T14:33:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-06-05T14:54:34.000Z (over 2 years ago)
- Last Synced: 2024-11-01T07:33:27.577Z (3 months ago)
- Language: Elixir
- Size: 30.3 KB
- Stars: 16
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - An Elli Elixir wrapper with some sugar syntax goodies. (Frameworks)
- fucking-awesome-elixir - exelli - An Elli Elixir wrapper with some sugar syntax goodies. (Frameworks)
- awesome-elixir - exelli - An Elli Elixir wrapper with some sugar syntax goodies. (Frameworks)
README
Exelli
======Elli elixir wrapper with some sugar sytnax goodies.
## Hello world
```elixir
defmodule MyHandler do
use Exelli.Handlerget [] do
{:ok, "HELLO"}
endget ["ping"] do
{:ok, "PONG"}end
get ["test"] do
{:ok, "WORKS"}
endpost ["test"] do
{:ok, "POST WORKS"}
endend
```then start elli with
```elixir
{:ok, pid} = Exelli.elli_start MyHandler.Simple
```## Router
```elixir
defmodule MyRouter douse Exelli.Router
enable MyMiddleware, [prefix: ["middleware"]]
enable MyHandlerend
```
and you can start it with
```elixir
{:ok, pid} = Exelli.elli_start MyRouter
```In fact, it's just a sugar syntax. You can still use:
```elixir
{:ok, pid} = Exelli.elli_start [{MyMiddleware, [prefix: ["middleware1"]]}, # normal prefix
{MySubSimple, "sub"}, # easy prefix
{MySimple, [prefix: []]}] # no prefix
```## Elli middlewares
You can obviously enable any other elli middleware. Add it to mix.exs, and enable like:
```elixir
defmodule MyRouter do
use Exelli.Router
enable MyMiddleware, [prefix: ["middleware"]]
enable MyHandler
enable :elli_dateend
```