# go-webassembly-framework
**Repository Path**: mirror_webframework/go-webassembly-framework
## Basic Information
- **Project Name**: go-webassembly-framework
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-07-25
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Oak - The Go WebAssembly Framework
===================================
[](https://godoc.org/github.com/elliotforbes/go-webassembly-framework) [](https://travis-ci.org/elliotforbes/go-webassembly-framework) [](https://goreportcard.com/report/github.com/elliotforbes/go-webassembly-framework)
With the advent of Go supporting WebAssembly, I thought I'd take a crack at building a really simple Go based WebAssembly framework that allows you to build simple frontend applications in Go, without having to dive too deep into the bushes.
---
## Goals
* Easier frontend application development using Go
## Tutorial
A tutorial describing Oak is avaiable here:
https://tutorialedge.net/golang/writing-frontend-web-framework-webassembly-go/
## CLI
If you want to easily run the example in this project, I suggest you try out the new `Oak CLI` which attempts to simplify the task of writing WebAssembly applications in Go.
```s
$ make build-cli
$ cd examples/blog
$ ./oak start
Starting Server
2019/01/06 12:00:37 listening on ":8080"...
```
## Simple Example
Let's take a look at how this framework could be used in a very simple example. We'll be create a really simple app that features on function, `mycoolfunc()`. We'll kick off our Oak framework within our `main()` function and then we'll register our `coolfunc()` function.
```go
package main
import (
"syscall/js"
"github.com/elliotforbes/oak"
)
func mycoolfunc(i []js.Value) {
println("My Awesome Function")
}
func main() {
oak.Start()
oak.RegisterFunction("coolfunc", mycoolfunc)
// keeps our app running
done := make(chan struct{}, 0)
<-done
}
```
We can then call our `coolfunc()` function from our `index.html` like so:
```html