@@ -32,10 +32,10 @@ Usage
32
32
The following sample server shows all features at once:
33
33
34
34
``` js
35
- const Boom = require (" boom" )
36
- const HAPI = require (" hapi" )
35
+ const Boom = require (" @hapi/boom" )
36
+ const HAPI = require (" @hapi/hapi" )
37
+ const HAPIAuthBasic = require (" @hapi/basic" )
37
38
const HAPIWebSocket = require (" hapi-plugin-websocket" )
38
- const HAPIAuthBasic = require (" hapi-auth-basic" )
39
39
const WebSocket = require (" ws" )
40
40
41
41
;(async () => {
@@ -191,8 +191,9 @@ $ curl -X POST --header 'Content-type: application/json' \
191
191
{" at" :" bar" ," mode" :" http" ," seen" :{" foo" :42}}
192
192
193
193
# access the exclusive WebSocket route via REST
194
- $ curl -X POST --header ' Content-type: application/json' --data ' { "foo": 42 }' http://127.0.0.1:12345/baz
195
- {" statusCode" :400," error" :" Bad Request" ," message" :" HTTP request to a WebSocket-only route not allowed" }
194
+ $ curl -X POST --header ' Content-type: application/json' \
195
+ --data ' { "foo": 42 }' http://127.0.0.1:12345/baz
196
+ {" statusCode" :400," error" :" Bad Request" ," message" :" Plain HTTP request to a WebSocket-only route not allowed" }
196
197
197
198
# access the combined REST/WebSocket route via WebSocket
198
199
$ wscat --connect ws://127.0.0.1:12345/bar
@@ -322,7 +323,6 @@ server.route({
322
323
...
323
324
}
324
325
})
325
-
326
326
` ` `
327
327
328
328
Notice
0 commit comments