This commit is contained in:
Andrey Parhomenko 2023-12-14 21:59:41 +03:00
parent 1350191dd4
commit 93eb265886
2 changed files with 14 additions and 14 deletions

View file

@ -1,25 +1,25 @@
package main
import (
"github.com/omnipunk/bond"
"github.com/di4f/bond"
)
var root = bond.Mux().
Def(
Def(
"",
bond.ApiFunc(func(c *bond.Context){
bond.ApiFunc(func(c *bond.Context) {
c.W.Write([]byte("This is the index page"))
}),
).Def(
).Def(
"hello",
bond.Mux().Def(
"en",
bond.ApiFunc(func(c *bond.Context){
bond.ApiFunc(func(c *bond.Context) {
c.W.Write([]byte("Hello, World!"))
}),
).Def(
"ru",
bond.ApiFunc(func(c *bond.Context){
bond.ApiFunc(func(c *bond.Context) {
c.W.Write([]byte("Привет, Мир!"))
}),
),
@ -28,10 +28,10 @@ Def(
bond.Static("./static"),
).Def(
"test",
bond.ApiFunc(func(c *bond.Context){
bond.ApiFunc(func(c *bond.Context) {
c.SetContentType(bond.PlainText)
c.Printf(
"Path: %q\n" +
"Path: %q\n"+
"Content-Type: %q\n",
c.Path(), c.ContentType(),
)

2
go.mod
View file

@ -1,3 +1,3 @@
module github.com/omnipunk/bond
module github.com/di4f/bond
go 1.21.3