-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
32 lines (24 loc) · 701 Bytes
/
Copy pathmain.go
File metadata and controls
32 lines (24 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"context"
"github.com/javorszky/go-wasm-talk/pkg/handlers"
"github.com/javorszky/go-wasm-talk/pkg/wasm"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
func main() {
// Create a new runner for our webassembly shenanigans
r := wasm.NewRunner(context.Background())
defer r.Stop()
// Handle http requests.
e := echo.New()
e.Use(handlers.PanicRecovery())
e.Use(middleware.Logger())
e.GET("/", handlers.Home())
e.GET("/add/:x/:y", handlers.Add(r))
e.GET("/date", handlers.Date(r))
e.GET("/nodate", handlers.NoDate(r))
e.GET("/hash/:what", handlers.Hash(r))
e.GET("/greet/:who", handlers.Greet(r))
e.Logger.Fatal(e.Start(":1323"))
}