Skip to content

Commit

Permalink
Angular 4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Bougarfaoui El Houcine committed Jun 7, 2017
1 parent bcc0685 commit 9d19b75
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.js

*.d.ts
*.map
24 changes: 24 additions & 0 deletions examples/chat-app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var http = require('http');
var path = require('path');
var express = require('express');
var app = express();



app.use(express.static(path.join(__dirname, 'public/dist')));

app.get('*', function(req, res, next) {
res.sendFile(__dirname+"/public/dist/index.html");
});


var server = http.createServer(app);
var io = require('socket.io')(server);
io.on('connection', function (socket) {
socket.emit('msg', { msg: 'Welcome bro!' });
socket.on('msg',function(msg){
socket.emit('msg', { msg: "you sent : "+msg });
})
});

server.listen(8988);
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"scripts": {
"test": "jasmine ./spec/socket.spec.js"
},
"dependencies": {
"@angular/common": "^4.1.3",
"devDependencies": {
"@angular/common": "^4.1.3",
"@angular/compiler": "^4.1.3",
"@angular/core": "^4.1.3",
"@angular/platform-browser": "^4.1.3",
Expand All @@ -30,9 +30,7 @@
"rxjs": "^5.0.1",
"socket.io": "^1.7.3",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"zone.js": "^0.7.2",
"@angular/compiler-cli": "^4.1.3",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.63",
Expand Down

0 comments on commit 9d19b75

Please sign in to comment.