Skip to content

Commit

Permalink
Set up Node.js server
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandruGhergut committed Apr 28, 2016
1 parent 30276ec commit 5718556
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
File renamed without changes.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset = "UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel = "stylesheet" type="text/css" href="style.css">
<link rel = "stylesheet" type="text/css" href="assets/css/style.css">
</head>

<body>
Expand Down
17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var express = require("express");
var app = express();
var http = require("http").Server(app);
var io = require("socket.io")(http);
var path = require("path");
var PORT = process.argv.length <= 2 ? 3000 : process.argv[2];

console.log(process.argv.length);
app.use("/assets/", express.static(__dirname + "/assets"));

app.get('/', function(request, response){
response.sendFile(__dirname + "/index.html");
});

http.listen(PORT, function(){
console.log('listening on localhost:' + PORT);
});
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "NodeDrawboard",
"version": "0.0.1",
"description": "Collaborative drawing board where users can share ideas and chat",
"dependencies": {
"express": "~4.10.2",
"socket.io": "~1.4.5"
}
}

0 comments on commit 5718556

Please sign in to comment.