This commit is contained in:
QkoSad
2024-11-28 14:36:15 +02:00
parent 06ea52ead6
commit fd82786671
12 changed files with 22 additions and 213 deletions
+3 -10
View File
@@ -19,12 +19,9 @@ namespace Server
listener.Prefixes.Add("http://localhost:5000/api/reset/");
listener.Prefixes.Add("http://localhost:5000/api/createp/");
// Start listening for incoming requests
// listen
listener.Start();
Console.WriteLine("Server is listening on http://localhost:5000/");
// god knows what that is
/* Thread listenerThread = new Thread(() => */
/* { */
while (true)
{
// wait for request
@@ -37,8 +34,7 @@ namespace Server
MySqlConnection conn = new MySqlConnection(connectionString);
// url after localhost:5000/
// i think the validation is unnecessry but the compiler has
// more experience
// i think the validation is unnecessry but the compiler doesn't
string uri;
if (request != null && request.Url != null)
{
@@ -74,12 +70,9 @@ namespace Server
response.OutputStream.Write(buffer, 0, buffer.Length);
break;
}
// Close the response
// send the response
response.OutputStream.Close();
}
/* }); */
/* // Start the listener thread */
/* listenerThread.Start(); */
}
}
}