https://github.com/genieframework/helloplugin.jl
Hello World example plugin for Genie Framework
https://github.com/genieframework/helloplugin.jl
Last synced: 7 months ago
JSON representation
Hello World example plugin for Genie Framework
- Host: GitHub
- URL: https://github.com/genieframework/helloplugin.jl
- Owner: GenieFramework
- Created: 2019-06-20T19:41:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-08T15:26:35.000Z (over 6 years ago)
- Last Synced: 2025-03-04T02:41:29.263Z (over 1 year ago)
- Language: Julia
- Size: 6.84 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hello World Genie Plugin
This is a simple example plugin for the Genie Framework. You can use it as a sample for developing Genie plugins or to try plugins installation in your Genie apps.
## Installation
Add the HelloPlugin package to your Genie app, just like any other Julia Pkg dependency:
```julia
pkg> add https://github.com/GenieFramework/HelloPlugin.jl
```
Bring the package into scope:
```julia
julia> using HelloPlugin
```
Install the plugin (this is a one time operation, when the package is added):
```julia
julia> HelloPlugin.install(@__DIR__)
```
Make sure you run this in the Genie app REPL or that you are in a Julia session in the app's root dir. Otherwise pass the app's root dir as the argument for `install(dest::String)`.
## Usage
The installation will add a new `hello` resource in `app/resources/hello/` in the form of `HelloController.jl` and `views/greet.jl.html`. Also, in your Genie app's `plugins/` folder you fill find a new file, `helloplugin.jl` (which is the plugins' initializer and is automatically loaded by Genie early in the bootstrap process).
The `helloplugin.jl` initializer is defining a new route `route("/hello", HelloController.greet)`. If you restart your Genie app and navigate to `/hello` you will get the plugin's greeting.
## More Info
For more information about Genie plugins read the Genie docs at