Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update readme and plugin guides #48

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading