MicroAPIFramework for Crystal Programming Language
require "raynode"
# Handlers for each route.
def index()
return "MAIN PAGE"
end
def sup()
return "SUP PAGE"
end
# Route Definitions.
ROUTES = {"/" => index,
"/r/sup" => sup}
# Listen and Serve...
Raynode::App.new(ROUTES, 8080)
-
Add the dependency to your
shard.yml
:dependencies: raynode: github: https://github.com/randiaz95/raynode
-
Run
shards install
require "raynode"
# Handlers
# Create all of the functions here.
def index()
return "MAIN PAGE"
end
def sup()
return "SUP PAGE"
end
# put a route to connnect to the function.
ROUTES = {"/" => index, "/r/sup" => sup}
# Listen and serve Raynode.
Raynode::App.new(ROUTES, 8080)
We need everything lol this is just a routing app for now...
- Fork it (https://github.com/your-github-user/raynode/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Randy Diaz - creator and maintainer