Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
krismyid committed Apr 17, 2015
1 parent a6221a8 commit 5ae8452
Show file tree
Hide file tree
Showing 6 changed files with 10,324 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# chat-example

This is the source code for a very simple chat example used for
the [Getting Started](http://socket.io/get-started/chat/) guide
of the Socket.IO website.
This is a sample webchat using socket.io.
With some modification for my courseworks.

Please refer to it to learn how to run this application.
The original version, please refer to http://socket.io/get-started/chat/ for more info.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title>Socket.IO chat</title>
<title>Chatbox!</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px Helvetica, Arial; }
Expand All @@ -18,8 +18,8 @@
<form action="">
<input id="m" autocomplete="off" /><button>Send</button>
</form>
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script src="socket.io-1.2.0.js"></script>
<script src="jquery-1.11.1.js"></script>
<script>
var socket = io();
$('form').submit(function(){
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
app.get('/socket.io-1.2.0.js', function(req, res){
res.sendFile(__dirname + '/socket.io-1.2.0.js');
});
app.get('/jquery-1.11.1.js', function(req, res){
res.sendFile(__dirname + '/jquery-1.11.1.js');
});

io.on('connection', function(socket){
socket.on('chat message', function(msg){
Expand Down
Loading

0 comments on commit 5ae8452

Please sign in to comment.