public string Process(HttpListenerContext context)
        {
            HttpListenerRequest request = context.Request;
            string url            = GetUrlofRequest(request);
            string responseToSend = _fileHandle.DataInFile(_fileHandle.FilePath(url, _url.GetAllPrefixes()));

            return(responseToSend);
        }
Example #2
0
 public void StartServer()
 {
     _listener = _requestListener.StartListening(_url.GetAllPrefixes());
     new Thread(_ =>
     {
         while (true)
         {
             HttpListenerContext context   = _listener.GetContext();
             HttpListenerRequest request   = context.Request;
             HttpListenerResponse response = context.Response;
             string url            = _request.GetUrlofRequest(request);
             string responseToSend = _fileHandle.DataInFile(_fileHandle.FilePath(url, _url.GetAllPrefixes()));
             _response.SendResponse(response, responseToSend);
         }
     }).Start();
 }