From 3c0c87cd3608a7e212a6f78c03786c26899439d2 Mon Sep 17 00:00:00 2001 From: Evert Date: Thu, 22 Sep 2016 18:41:37 +0300 Subject: [PATCH] initial --- .gitignore | 2 ++ README.md | 2 ++ package.json | 24 ++++++++++++++++++++++++ public/css/main.css | 5 +++++ public/index.html | 17 +++++++++++++++++ public/js/main.js | 9 +++++++++ public/main.styl | 6 ++++++ teemant.js | 21 +++++++++++++++++++++ 8 files changed, 86 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 package.json create mode 100644 public/css/main.css create mode 100644 public/index.html create mode 100644 public/js/main.js create mode 100644 public/main.styl create mode 100755 teemant.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d49756d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules/ +/build/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..6c6c966 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# TeemantIRC +When will I /ever/ finish an IRC client.. diff --git a/package.json b/package.json new file mode 100644 index 0000000..15d685a --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/public/css/main.css b/public/css/main.css new file mode 100644 index 0000000..4e8f330 --- /dev/null +++ b/public/css/main.css @@ -0,0 +1,5 @@ +body { + margin: 0; + padding: 0; + font-family: Open Sans, Everson Mono, Helvetica; +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..bcd5b17 --- /dev/null +++ b/public/index.html @@ -0,0 +1,17 @@ + + + + + TeemantIRC + + + + + + + + + + + + diff --git a/public/js/main.js b/public/js/main.js new file mode 100644 index 0000000..5bddd8c --- /dev/null +++ b/public/js/main.js @@ -0,0 +1,9 @@ +window.onload = function() { + + var messages = []; + var socket = io.connect('http://localhost:8080'); + + socket.on('connect', function (data) { + alert("socketio works!") + }); +} diff --git a/public/main.styl b/public/main.styl new file mode 100644 index 0000000..c1d70c7 --- /dev/null +++ b/public/main.styl @@ -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 diff --git a/teemant.js b/teemant.js new file mode 100755 index 0000000..51cf81f --- /dev/null +++ b/teemant.js @@ -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) +});