<commit_before>var http   = require("http"),
    url    = require("url"),
    wompt  = require("./includes"),
    io     = require("socket.io"),
    logger = wompt.logger,
    mongodb = wompt.db,
    express = require("express");


function App(options){
	this.channels = {};
	this.config = options.config;
	this.clients = new wompt.ClientPool();
	this.express = this.create_express_server();
	
	this.socket_middleware = [
		express.cookieDecoder()
	];
}

App.prototype = {

	create_express_server:function(){
		var config = this.config;
		var exp = express.createServer();
		
		exp.configure(function(){
			exp.use(express.logger({format: ':method :url :status :response-time' }));
			exp.use(express.cookieDecoder());
			exp.use(express.staticProvider(config.public_dir));
		});
		
		exp.set('view engine', 'jade');
		
		exp.get("/chat/:channel", function(req, res, params){
			wompt.Auth.get_or_set_token(req, res);
			
			res.render('index', {
				locals:{
					channel: req.params.channel
				}
			});
		});
		
		
		exp.get("/users/new", function(req, res, params){
			res.render('users/new');
		});
		
		exp.post("/users/new", express.bodyDecoder(), function(req, res, params){
			b = req.body;
			var user = new User({
				name: b.name
			});
			user.save();
		});<commit_msg>Fixed sign-up bug and sign-in on sign-up and redirect to chat/room1<commit_after>var http   = require("http"),
    url    = require("url"),
    wompt  = require("./includes"),
    io     = require("socket.io"),
    logger = wompt.logger,
    mongodb = wompt.db,
    express = require("express");


function App(options){
	this.channels = {};
	this.config = options.config;
	this.clients = new wompt.ClientPool();
	this.express = this.create_express_server();
	
	this.socket_middleware = [
		express.cookieDecoder()
	];
}

App.prototype = {

	create_express_server:function(){
		var config = this.config;
		var exp = express.createServer();
		
		exp.configure(function(){
			exp.use(express.logger({format: ':method :url :status :response-time' }));
			exp.use(express.cookieDecoder());
			exp.use(express.staticProvider(config.public_dir));
		});
		
		exp.set('view engine', 'jade');
		
		exp.get("/chat/:channel", function(req, res, params){
			wompt.Auth.get_or_set_token(req, res);
			
			res.render('index', {
				locals:{
					channel: req.params.channel
				}
			});
		});
		
		
		exp.get("/users/new", function(req, res, params){
			res.render('users/new');
		});
		
		exp.post("/users/new", express.bodyDecoder(), function(req, res, params){
			b = req.body;
			var user = new wompt.User({
				name: b.name
			});
			user.save();
			
			wompt.Auth.start_session(res, user);
			res.redirect('/chat/room1');	
		});
{'fraction_non_alphanumeric': 0.17869034406215317, 'fraction_numerical': 0.0007399186089530152, 'mean_word_length': 3.3264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5030819', 'n_tokens_mistral': 1047, 'n_tokens_neox': 899, 'n_words': 163}