Update starter to alpha-23
This commit is contained in:
parent
0aabccf76a
commit
d884774343
12
src/app.ts
12
src/app.ts
|
|
@ -1,12 +0,0 @@
|
|||
import { NestApplication } from 'nest.js';
|
||||
|
||||
export class Application implements NestApplication {
|
||||
constructor(private expressApp) {}
|
||||
|
||||
start() {
|
||||
// do something before server start
|
||||
this.expressApp.listen(3031, () => {
|
||||
console.log('Application listen on port:', 3031);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
import { Subject } from 'rxjs/Subject';
|
||||
import { SocketGateway, GatewayServer, SubscribeMessage } from 'nest.js/socket';
|
||||
import { WebSocketGateway, WebSocketServer, SubscribeMessage } from 'nest.js/websockets';
|
||||
|
||||
@SocketGateway({ port: 2000 })
|
||||
@WebSocketGateway({ port: 2000 })
|
||||
export class ChatGateway {
|
||||
private msg$ = new Subject<any>();
|
||||
|
||||
@GatewayServer server;
|
||||
@WebSocketServer()
|
||||
server;
|
||||
|
||||
get msgStream() {
|
||||
return this.msg$.asObservable();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { NestRunner } from 'nest.js';
|
||||
import { Application } from './app';
|
||||
import { NestFactory } from 'nest.js';
|
||||
import { ApplicationModule } from './modules/app.module';
|
||||
|
||||
NestRunner.run(Application, ApplicationModule);
|
||||
const app = NestFactory.create(ApplicationModule);
|
||||
app.listen(3000, () => console.log('Application is listening on port 3000.'));
|
||||
Loading…
Reference in New Issue