Orbit is a golang server side processing framework for building server side web applications.
Name | Extent of support |
---|---|
Vanilla Javascript | Full support |
Client side React | Full support |
Server side React | Experimental |
Vue | Planned |
go install github.com/GuyARoss/orbit@latest
go build
.There are several examples that exist in the ./examples. Here is a basic one to get you up and running.
orbit init
, then follow the prompts// /pages/hello-world.jsx
const HelloWorldComponent = ({ from }) => {
return (
<>
<div> Hello, from {from} </div>
</>
)
}
export default HelloWorldComponent
orbit build
// main.go
package main
import (
// ...
)
func main() {
// orbitgen comes from an autogenerated lib output from orbit
orb, err := orbitgen.New()
if err != nil {
panic(err)
}
orb.HandleFunc("/", func (r *orbitgen.Request) {
props := make(map[string]interface{})
// sets the prop 'from' to the string 'orbit'
props["from"] = "orbit"
// renders a single page & passes props into the component
c.RenderPage(orbitgen.HelloWorldComponent, props)
// can also use c.RenderPages(...) to build a micro-frontend
})
http.ListenAndServe(":3030", orb.Serve())
}
Run golang application with go run main.go
Please first read our contributing guide before contributing to this project.
To gain exposure to the project you can find a list of good first issues.
Author: GuyARoss
Source Code: https://github.com/GuyARoss/orbit
License: GPL-3.0 license