update some examples

Former-commit-id: 2ed7c323dd379eb68d5ccb2044cd9cc772ce0b08
This commit is contained in:
Gerasimos (Makis) Maropoulos 2020-05-05 22:03:01 +03:00
parent c10dd32ad7
commit cc19f80049
14 changed files with 20 additions and 19 deletions

2
.gitignore vendored
View File

@ -4,6 +4,4 @@ _authortools
.directory .directory
node_modules node_modules
package-lock.json package-lock.json
_benchmarks/benchmarker/benchmarker.exe
_benchmarks/benchmarker/platforms
go.sum go.sum

View File

@ -1,6 +1,7 @@
# Table of Contents # Table of Contents
* Tutorials * Tutorials
* [Dockerize](tutorial/docker)
* [Caddy](tutorial/caddy) * [Caddy](tutorial/caddy)
* [MongoDB](tutorial/mongodb) * [MongoDB](tutorial/mongodb)
* [Dropzone.js](tutorial/dropzonejs) * [Dropzone.js](tutorial/dropzonejs)
@ -79,7 +80,7 @@
* [Embedded Single Page Application with other routes](file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go) * [Embedded Single Page Application with other routes](file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go)
* View * View
* [Overview](view/overview/main.go) * [Overview](view/overview/main.go)
* [Hi](view/template_html_0/main.go) * [Basic](view/template_html_0/main.go)
* [A simple Layout](view/template_html_1/main.go) * [A simple Layout](view/template_html_1/main.go)
* [Layouts: `yield` and `render` tmpl funcs](view/template_html_2/main.go) * [Layouts: `yield` and `render` tmpl funcs](view/template_html_2/main.go)
* [The `urlpath` tmpl func](view/template_html_3/main.go) * [The `urlpath` tmpl func](view/template_html_3/main.go)
@ -87,14 +88,14 @@
* [Inject Data Between Handlers](view/context-view-data/main.go) * [Inject Data Between Handlers](view/context-view-data/main.go)
* [Embedding Templates Into App Executable File](view/embedding-templates-into-app/main.go) * [Embedding Templates Into App Executable File](view/embedding-templates-into-app/main.go)
* [Write to a custom `io.Writer`](view/write-to) * [Write to a custom `io.Writer`](view/write-to)
* [Greeting with Pug (Jade)`](view/template_pug_0) * [Pug: Greeting](view/template_pug_0)
* [Pug (Jade) Actions`](view/template_pug_1) * [Pug: `Actions`](view/template_pug_1)
* [Pug (Jade) Includes`](view/template_pug_2) * [Pug: `Includes`](view/template_pug_2)
* [Pug (Jade) Extends`](view/template_pug_3) * [Pug: `Extends`](view/template_pug_3)
* [Jet](/view/template_jet_0) * [Jet Template](/view/template_jet_0)
* [Jet Embedded](view/template_jet_1_embedded) * [Jet Embedded](view/template_jet_1_embedded)
* [Jet 'urlpath' tmpl func](/view/template_jet_2) * [Jet 'urlpath' tmpl func](/view/template_jet_2)
* [Jet template funcs from structure](/view/template_jet_3) * [Jet Template Funcs from Struct](/view/template_jet_3)
* Third-Parties * Third-Parties
* [Render `valyala/quicktemplate` templates](http_responsewriter/quicktemplate) * [Render `valyala/quicktemplate` templates](http_responsewriter/quicktemplate)
* [Render `shiyanhui/hero` templates](http_responsewriter/herotemplate) * [Render `shiyanhui/hero` templates](http_responsewriter/herotemplate)
@ -121,6 +122,7 @@
* [Transactions](http_responsewriter/transactions/main.go) * [Transactions](http_responsewriter/transactions/main.go)
* [SSE](http_responsewriter/sse/main.go) * [SSE](http_responsewriter/sse/main.go)
* [SSE (third-party package usage for server sent events)](http_responsewriter/sse-third-party/main.go) * [SSE (third-party package usage for server sent events)](http_responsewriter/sse-third-party/main.go)
* [Webassemply](webassemply/basic/main.go)
* Cache * Cache
* [Simple](cache/simple/main.go) * [Simple](cache/simple/main.go)
* [Client-Side (304)](cache/client-side/main.go) * [Client-Side (304)](cache/client-side/main.go)

View File

@ -36,7 +36,7 @@ func newApp() *iris.Application {
// You can also register any index handler manually, order of registration does not matter: // You can also register any index handler manually, order of registration does not matter:
// v1.Get("/static", [...custom middleware...], func(ctx iris.Context) { // v1.Get("/static", [...custom middleware...], func(ctx iris.Context) {
// [...custom code...] // [...custom code...]
// ctx.ServeFile("./assets/index.html", false) // ctx.ServeFile("./assets/index.html")
// }) // })
// http://localhost:8080/v1/static // http://localhost:8080/v1/static

View File

@ -1,6 +1,6 @@
module github.com/kataras/iris/_examples/http-listening/http3-quic module github.com/kataras/iris/_examples/http-listening/http3-quic
go 1.12 go 1.14
require ( require (
github.com/prometheus/client_golang v1.0.0 github.com/prometheus/client_golang v1.0.0

View File

@ -1,6 +1,6 @@
module app module app
go 1.13 go 1.14
require ( require (
github.com/kataras/iris/v12 v12.2.0 github.com/kataras/iris/v12 v12.2.0

View File

@ -9,7 +9,7 @@ import (
) )
func main() { func main() {
// GOARCH=wasm GOOS=js /home/$yourusername/go1.11/bin/go build -o hello.wasm hello_go111.go // GOARCH=wasm GOOS=js /home/$yourusername/go1.14/bin/go build -o hello.wasm hello_go114.go
js.Global().Get("console").Call("log", "Hello WebAssemply!") js.Global().Get("console").Call("log", "Hello WebAssemply!")
message := fmt.Sprintf("Hello, the current time is: %s", time.Now().String()) message := fmt.Sprintf("Hello, the current time is: %s", time.Now().String())
js.Global().Get("document").Call("getElementById", "hello").Set("innerText", message) js.Global().Get("document").Call("getElementById", "hello").Set("innerText", message)

View File

@ -5,8 +5,8 @@ import (
) )
/* /*
You need to build the hello.wasm first, download the go1.11 and execute the below command: You need to build the hello.wasm first, download the go1.14 and execute the below command:
$ cd client && GOARCH=wasm GOOS=js /home/$yourname/go1.11/bin/go build -o hello.wasm hello_go111.go $ cd client && GOARCH=wasm GOOS=js /home/$yourname/go1.14/bin/go build -o hello.wasm hello_go114.go
*/ */
func main() { func main() {
@ -17,7 +17,8 @@ func main() {
app.HandleDir("/", "./client") app.HandleDir("/", "./client")
app.Get("/", func(ctx iris.Context) { app.Get("/", func(ctx iris.Context) {
ctx.ServeFile("./client/hello.html", false) // true for gzip. // ctx.Gzip(true)
ctx.ServeFile("./client/hello.html")
}) })
// visit http://localhost:8080 // visit http://localhost:8080

View File

@ -110,7 +110,7 @@ func main() {
// serves the browser-based websocket client. // serves the browser-based websocket client.
app.Get("/", func(ctx iris.Context) { app.Get("/", func(ctx iris.Context) {
ctx.ServeFile("./browser/index.html", false) ctx.ServeFile("./browser/index.html")
}) })
// serves the npm browser websocket client usage example. // serves the npm browser websocket client usage example.

View File

@ -1,8 +1,8 @@
module github.com/kataras/iris/_examples/websocket/socketio module github.com/kataras/iris/_examples/websocket/socketio
go 1.13 go 1.14
require ( require (
github.com/googollee/go-socket.io v1.4.3-0.20191109153049-7451e2f8c2e0 github.com/googollee/go-socket.io v1.4.3-0.20191109153049-7451e2f8c2e0
github.com/kataras/iris/v12 v12.1.8 github.com/kataras/iris/v12 v12.2.0
) )