This commit is contained in:
Evert Prants 2016-09-22 18:41:37 +03:00
commit 3c0c87cd36
8 changed files with 86 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/node_modules/
/build/

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# TeemantIRC
When will I /ever/ finish an IRC client..

24
package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "teemantirc",
"version": "1.0.0",
"description": "Web-based IRC client ",
"main": "teemant.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"irc"
],
"author": "Evert",
"license": "MIT",
"dependencies": {
"express": "^4.14.0",
"jade": "^1.11.0",
"morgan": "^1.7.0",
"socketio": "^1.0.0"
},
"repository": {
"type": "git",
"url": "git://github.com/DiamondtechDev/TeemantIRC.git"
}
}

5
public/css/main.css Normal file
View File

@ -0,0 +1,5 @@
body {
margin: 0;
padding: 0;
font-family: Open Sans, Everson Mono, Helvetica;
}

17
public/index.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TeemantIRC</title>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<!-- Codepony Diamond -->
<body>
</body>
</html>

9
public/js/main.js Normal file
View File

@ -0,0 +1,9 @@
window.onload = function() {
var messages = [];
var socket = io.connect('http://localhost:8080');
socket.on('connect', function (data) {
alert("socketio works!")
});
}

6
public/main.styl Normal file
View File

@ -0,0 +1,6 @@
// Run `stylus -w main.styl -o css` to compile
body
margin: 0
padding: 0
font-family: Open Sans, Everson Mono, Helvetica

21
teemant.js Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env node
'use strict';
let express = require("express");
let path = require("path");
let sockio = require('socket.io');
let app = express();
let pubdir = path.join(__dirname+"/public");
let port = 8080;
app.get("/", function(req, res){
res.sendFile(pubdir+"/index.html");
});
app.use(express.static(__dirname + '/public'));
let io = sockio.listen(app.listen(port));
console.log("Listening on port " + port);
io.sockets.on('connection', function (socket) {
console.log(socket)
});