<commit_before>package main

// import "fmt"
// import "github.com/gorilla/mux"
// import "net/http"

import (
	"fmt"
	// "github.com/gorilla/mux"
	"log"
	"net/http"
	"github.com/googollee/go-socket.io"
	"github.com/go-redis/redis"
	"time"
)

var client *redis.Client

func init() {
	log.Println("Initializing redis client")
	client = redis.NewTCPClient(&redis.Options{
		Addr: ":6379",
	})
}

func getMessages(channel string) {
	log.Println("We got a string ", channel)

}

func onConnect(ns *socketio.NameSpace) {
	fmt.Println("connected:", ns.Id(), " in channel ", ns.Endpoint())
	ns.Emit("message", "this is totally news", 3)
}

func LoginHandler(w http.ResponseWriter, r *http.Request) {
	// name := r.URL.Path[len("/name="/"):]
	name := r.FormValue("name")
	password := r.FormValue("password")
	fmt.Fprintf(w, "Hello, %q password for %q", name, password)
	// log.Println("Listening...")
	// params := mux.Vars(r)
	// log.Println(params)
	// name := params["name"]
	// password := params["password"]
	// w.Write([]byte("Hello " + name + " and pw " + password))
}

func HomeHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("We are here in HomeHandler")

	// fmt.Fprintf(w, "HomeHandler")
}

func main() {
	// init()

	getMessages("Lobby")

    fmt.Printf("Redis Chat - online\n")
	// r := mux.NewRouter()

    http.HandleFunc("/login", LoginHandler)
    // r.PathPrefix("/").Handler(http.FileServer(http.Dir("../../client/RedisChat/www")))
    // r.Handle("/static", http.FileServer(http.Dir("../../client/RedisChat/www")))

    // r.Handle("/static", http.FileServer(http.Dir("./client/RedisChat/www")) )

    
    // http.Handle("/", r)
    // clientDirectory := http.Dir("../../client/RedisChat/www")
    clientDirectory := http.Dir("./client/RedisChat/www")<commit_msg>Added comment, still need to figure out how to handle application/json requests for /login POSTing<commit_after>package main

// import "fmt"
// import "github.com/gorilla/mux"
// import "net/http"

import (
	"fmt"
	// "github.com/gorilla/mux"
	"log"
	"net/http"
	"github.com/googollee/go-socket.io"
	"github.com/go-redis/redis"
	// "time"
)

var client *redis.Client

func init() {
	log.Println("Initializing redis client")
	client = redis.NewTCPClient(&redis.Options{
		Addr: ":6379",
	})
	log.Println("Redis up and going")
}

func getMessages(channel string) {
	log.Println("We got a string ", channel)

}

func onConnect(ns *socketio.NameSpace) {
	fmt.Println("connected:", ns.Id(), " in channel ", ns.Endpoint())
	ns.Emit("message", "this is totally news", 3)
}

func LoginHandler(w http.ResponseWriter, r *http.Request) {
	// name := r.URL.Path[len("/name="/"):]
	name := r.FormValue("name")
	password := r.FormValue("password")
	// fmt.Fprintf(w, "Hello, %q password for %q", name, password)
	log.Println(r)
	// params := mux.Vars(r)
	// log.Println(params)
	// name := params["name"]
	// password := params["password"]
	// w.Write([]byte("Hello " + name + " and pw " + password))
	log.Println("We have a user - " + name + ":" + password)

	client.Set("user:" + name, "151515")

}

func HomeHandler(w http.ResponseWriter, r *http.Request) {
	log.Println("We are here in HomeHandler")

	// fmt.Fprintf(w, "HomeHandler")
}

func main() {
	// init()

	getMessages("Lobby")

    fmt.Printf("Redis Chat - online\n")
	// r := mux.NewRouter()

    http.HandleFunc("/login", LoginHandler)
    // r.PathPrefix("/").Handler(http.FileServer(http.Dir("../../client/RedisChat/www")))
    // r.Handle("/static", http.FileServer(http.Dir("../../client/RedisChat/www")))

    // r.Handle("/static", http.FileServer(http.Dir("./client/RedisChat/www")) )

    
    // http.Handle("/", r)
    // clientDirectory := http.Dir("../../client/RedisChat/www")
    clientDirectory := http.Dir("./client/RedisChat/www")
{'fraction_non_alphanumeric': 0.20923482849604222, 'fraction_numerical': 0.004221635883905013, 'mean_word_length': 3.567469879518072, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, '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': '1254529', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1369, 'n_words': 258}