Skip to content

Commit

Permalink
docs: update readme and plugin guides
Browse files Browse the repository at this point in the history
  • Loading branch information
aristotelesbr committed May 17, 2024
1 parent 2027d83 commit 63e8f1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions guides/plugin/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ Plugins.register(:my_custom_plugin, MyCustomPlugin)

To load and use a plugin in your Lennarb application, call the plugin method in your application class.

```ruby
Lennarb.new do |app|
app.plugin :my_custom_plugin

app.get '/custom' do |req, res|
res.status = 200
res.html(custom_method)
end
end
```

And if you are using the `Lennarb::Application::Base` class, you can use the `plugin` method directly in your application class.

```ruby
class MyApp < Lennarb::Application::Base
plugin :my_custom_plugin
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Plese see [Performance](https://aristotelesbr.github.io/lennarb/guides/performan

- [Performance](https://aristotelesbr.github.io/lennarb/guides/performance/index.html) - The **Lennarb** is very fast. The following benchmarks were performed on a MacBook Pro (Retina, 13-inch, Early 2013) with 2,7 GHz Intel Core i7 and 8 GB 1867 MHz DDR3. Based on [jeremyevans/r10k](https://github.com/jeremyevans/r10k) using the following [template build](static/r10k/build/lennarb.rb).

- [Plugin](https://aristotelesbr.github.io/lennarb/guides/plugin/index.html) - You can create your plugins to extend the functionality of the framework.

- [Response](https://aristotelesbr.github.io/lennarb/guides/response/index.html) - This is the response guide.
The `res` object is used to send a response to the client. The Lennarb use a custom response object to send responses to the client. The `res` object is an instance of `Lennarb::Response`.

Expand Down

0 comments on commit 63e8f1b

Please sign in to comment.