File tree Expand file tree Collapse file tree 7 files changed +8
-8
lines changed
sample1-simple-controller
sample2-use-created-socket-io Expand file tree Collapse file tree 7 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
< html >
2
- < script src ="../../node_modules/socket.io-client/socket.io.js "> </ script >
2
+ < script src ="../../node_modules/socket.io-client/dist/ socket.io.js "> </ script >
3
3
< script >
4
4
var socket = io ( "http://localhost:3001" ) ;
5
5
socket . on ( "message_saved" , function ( message ) {
Original file line number Diff line number Diff line change 1
1
< html >
2
- < script src ="../../node_modules/socket.io-client/socket.io.js "> </ script >
2
+ < script src ="../../node_modules/socket.io-client/dist/ socket.io.js "> </ script >
3
3
< script >
4
4
var socket = io ( "http://localhost:3001" ) ;
5
5
socket . on ( "message_saved" , function ( message ) {
6
6
console . log ( "Saved message received back: " , message ) ;
7
7
} ) ;
8
8
9
9
function onClick ( ) {
10
- socket . emit ( "save" , { text : "Hello this is message" } ) ;
10
+ socket . to ( ) . emit ( "save" , { text : "Hello this is message" } ) ;
11
11
}
12
12
</ script >
13
13
< body >
Original file line number Diff line number Diff line change 1
1
< html >
2
- < script src ="../../node_modules/socket.io-client/socket.io.js "> </ script >
2
+ < script src ="../../node_modules/socket.io-client/dist/ socket.io.js "> </ script >
3
3
< script >
4
4
var socket = io ( "http://localhost:3001/messages" ) ;
5
5
socket . on ( "message_saved" , function ( message ) {
Original file line number Diff line number Diff line change 1
1
< html >
2
- < script src ="../../node_modules/socket.io-client/socket.io.js "> </ script >
2
+ < script src ="../../node_modules/socket.io-client/dist/ socket.io.js "> </ script >
3
3
< script >
4
4
var socket = io ( "http://localhost:3001" ) ;
5
5
socket . on ( "message_save_success" , function ( message ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import {Middleware} from "../../src/decorators";
2
2
import { MiddlewareInterface } from "../../src/MiddlewareInterface" ;
3
3
4
4
@Middleware ( )
5
- export class AuthenitificationMiddleware implements MiddlewareInterface {
5
+ export class AuthenticationMiddleware implements MiddlewareInterface {
6
6
7
7
use ( socket : any , next : ( ( err ?: any ) => any ) ) : any {
8
8
console . log ( "authentication..." ) ;
Original file line number Diff line number Diff line change 1
1
import "reflect-metadata" ;
2
2
import { createSocketServer } from "../../src/index" ;
3
- import "./AuthenitificationMiddleware " ;
3
+ import "./AuthenticationMiddleware " ;
4
4
import "./MessageController" ;
5
5
6
6
// import all required files
Original file line number Diff line number Diff line change 1
1
< html >
2
- < script src ="../../node_modules/socket.io-client/socket.io.js "> </ script >
2
+ < script src ="../../node_modules/socket.io-client/dist/ socket.io.js "> </ script >
3
3
< script >
4
4
var socket = io ( "http://localhost:3001" ) ;
5
5
socket . on ( "message_saved" , function ( message ) {
You can’t perform that action at this time.
0 commit comments