https://github.com/preaction/mojo.go
The Mojolicious Web Framework, ported to Go
https://github.com/preaction/mojo.go
Last synced: about 1 year ago
JSON representation
The Mojolicious Web Framework, ported to Go
- Host: GitHub
- URL: https://github.com/preaction/mojo.go
- Owner: preaction
- Created: 2021-05-31T05:01:19.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-21T16:24:00.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T15:44:27.359Z (about 2 years ago)
- Language: Go
- Size: 4.69 MB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mojo
package mojo is a web application framework, ported from the
Mojolicious web framework for the Perl language.
In the Mojolicious framework, an author builds an Application object,
registers handlers for one or more Routes, and then starts the
application using its Start() method.
```go
package main
import "github.com/preaction/mojo.go"
import "fmt"
func main() {
app := mojo.NewApplication()
app.Renderer.AddTemplate("greet", "Hello, <% .Stash.name %>!\n")
app.Routes.Get( "/:name", mojo.Stash{"name": "World"}).To( GreetHandler )
app.Start()
}
func GreetHandler( c *mojo.Context ) {
c.Render( "greet" )
}
```
## Sub Packages
* [mojo](./mojo)
* [testmojo](./testmojo)
* [util](./util)
---
Readme created from Go doc with [goreadme](https://github.com/posener/goreadme)