Skip to content
This repository has been archived by the owner on Dec 1, 2017. It is now read-only.

Commit

Permalink
Adding boiler plates and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
boopathi committed Nov 27, 2012
1 parent 4c01187 commit cf56ec5
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "wordament",
"version": "0.0.1",
"description": "wordament",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "git@github.com:boopathi/wordament.git"
},
"dependencies": {
"express": "3.x",
"connect": "x",
"ejs": "0.8.x",
"passport": "x",
"passport-google": "x",
"passport-facebook": "x",
"express-params": "x",
"validator": "x"
},
"engines": {
"node": "0.8.x"
},
"subdomain": "wordament"
}
50 changes: 48 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,55 @@
var wordament = require("./build/Release/wordament.node");
/*
*
*
* @author Boopathi Rajaa <http://boopathi.in/>
* @description app main-file
* @copyright Copyright (c) 2012 Boopathi Rajaa <http://boopathi.in/>
* @license <http://www.opensource.org/licenses/mit-license.html>
*
*
*/

console.log(wordament.getMatrix());
//boiler-plates
var express = require('express'),
app = express(),
connect = require('connect'),
params = require('express-params'),
server = require('http').createServer(app).listen(process.env.PORT || 8080),
ejs = require('ejs'),
socketio = require('socketio'),
_validate = require('validator'),
wordament = require("./build/Release/wordament.node");

app.configure( function () {
app.use(connect.compress());
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({secret: "WORDAMENT :P" }));
app.use("/static", express.static(__dirname + "/static"));
app.set("view engine", 'ejs');
app.param(function(name, fn){
if (fn instanceof RegExp) {
return function(req, res, next, val){
var captures;
if (captures = fn.exec(String(val))) {
req.params[name] = captures;
next();
} else next('route');
}
}
});
});

app.get('/', function(req,res) {
res.render('index', {
question: wordament.getMatrix();
});
})

var solution = wordament.solution();
var ss = "";
for(var i=0;i<solution.length;i++)
ss = ss + ", "+ solution[i];
console.log(ss);


0 comments on commit cf56ec5

Please sign in to comment.