mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
all examples and tests ran successfully based on iris v11.2.0 and go+gomodules 1.12.7
Former-commit-id: a3a9056b321c059b52bd0d46d727a3eb8204174a
This commit is contained in:
parent
9364dde3ca
commit
94f67f7fbb
|
@ -54,14 +54,10 @@ func (b *Bootstrapper) SetupSessions(expires time.Duration, cookieHashKey, cooki
|
|||
}
|
||||
|
||||
// SetupWebsockets prepares the websocket server.
|
||||
func (b *Bootstrapper) SetupWebsockets(endpoint string, onConnection websocket.ConnectionFunc) {
|
||||
ws := websocket.New(websocket.Config{})
|
||||
ws.OnConnection(onConnection)
|
||||
func (b *Bootstrapper) SetupWebsockets(endpoint string, handler websocket.ConnHandler) {
|
||||
ws := websocket.New(websocket.DefaultGorillaUpgrader, handler)
|
||||
|
||||
b.Get(endpoint, ws.Handler())
|
||||
b.Any("/iris-ws.js", func(ctx iris.Context) {
|
||||
ctx.Write(websocket.ClientSource)
|
||||
})
|
||||
b.Get(endpoint, websocket.Handler(ws))
|
||||
}
|
||||
|
||||
// SetupErrorHandlers prepares the http error handlers
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<!-- -->
|
||||
<script src="https://unpkg.com/director@1.2.8/build/director.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/neffos.js@latest/dist/neffos.min.js"></script>
|
||||
<!-- -->
|
||||
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none;
|
||||
|
@ -24,20 +24,22 @@
|
|||
<section class="todoapp">
|
||||
<header class="header">
|
||||
<h1>todos</h1>
|
||||
<input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" v-model="newTodo" @keyup.enter="addTodo">
|
||||
<input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" v-model="newTodo"
|
||||
@keyup.enter="addTodo">
|
||||
</header>
|
||||
<section class="main" v-show="todos.length" v-cloak>
|
||||
<input class="toggle-all" type="checkbox" v-model="allDone">
|
||||
<ul class="todo-list">
|
||||
<li v-for="todo in filteredTodos" class="todo" :key="todo.id" :class="{ completed: todo.completed, editing: todo == editedTodo }">
|
||||
<li v-for="todo in filteredTodos" class="todo" :key="todo.id"
|
||||
:class="{ completed: todo.completed, editing: todo == editedTodo }">
|
||||
<div class="view">
|
||||
<!-- v-model="todo.completed" -->
|
||||
<input class="toggle" type="checkbox" @click="completeTodo(todo)">
|
||||
<label @dblclick="editTodo(todo)">{{ todo.title }}</label>
|
||||
<button class="destroy" @click="removeTodo(todo)"></button>
|
||||
</div>
|
||||
<input class="edit" type="text" v-model="todo.title" v-todo-focus="todo == editedTodo" @blur="doneEdit(todo)" @keyup.enter="doneEdit(todo)"
|
||||
@keyup.esc="cancelEdit(todo)">
|
||||
<input class="edit" type="text" v-model="todo.title" v-todo-focus="todo == editedTodo" @blur="doneEdit(todo)"
|
||||
@keyup.enter="doneEdit(todo)" @keyup.esc="cancelEdit(todo)">
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
|
Loading…
Reference in New Issue
Block a user