forked from chookspace/chookchat
		
	Add web client, update CLI client
This commit is contained in:
		@@ -13,6 +13,9 @@ import java.io.BufferedReader
 | 
			
		||||
import java.math.BigInteger
 | 
			
		||||
import java.security.MessageDigest
 | 
			
		||||
 | 
			
		||||
import java.nio.file.Paths
 | 
			
		||||
import java.nio.file.Files
 | 
			
		||||
 | 
			
		||||
fun md5(input:String): String {
 | 
			
		||||
    val md = MessageDigest.getInstance("MD5")
 | 
			
		||||
    return BigInteger(1, md.digest(input.toByteArray())).toString(16).padStart(32, '0')
 | 
			
		||||
@@ -447,8 +450,11 @@ fun authKey(inputData: String): String {
 | 
			
		||||
fun main(args: Array<String>) {
 | 
			
		||||
    WsSessionManager.peopleOnline.removeAt(0)
 | 
			
		||||
    WsSessionManager.sessionsList.removeAt(0)
 | 
			
		||||
    val app = Javalin.create()
 | 
			
		||||
        .get("/") { ctx -> ctx.result("dingus") }
 | 
			
		||||
    val app = Javalin.create { config ->
 | 
			
		||||
            config.staticFiles.add("/public")
 | 
			
		||||
        }.get("/") { ctx -> 
 | 
			
		||||
            ctx.redirect("/index.html") 
 | 
			
		||||
        }
 | 
			
		||||
        .get("/api/send/{content}") { ctx -> 
 | 
			
		||||
            val result = handleSentMessage(ctx.pathParam("content"))
 | 
			
		||||
            if (result == "Success") {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user