first commit
This commit is contained in:
@ -1,23 +0,0 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
#include <iostream>
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Http;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
using namespace Tesses::Framework::TextStreams;
|
||||
using namespace Tesses::Framework::Threading;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TF_Init();
|
||||
if(argc < 1)
|
||||
{
|
||||
printf("USAGE: %s <dir>\n",argv[0]);
|
||||
return 0;
|
||||
}
|
||||
FileServer fs(argv[1],true,false);
|
||||
HttpServer server(10000U,fs);
|
||||
server.StartAccepting();
|
||||
TF_RunEventLoop();
|
||||
std::cout << "Closing server" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
#include <iostream>
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::Streams;
|
||||
using namespace Tesses::Framework::Http;
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if(argc < 3)
|
||||
{
|
||||
printf("USAGE: %s <url> <path>\n",argv[0]);
|
||||
return 1;
|
||||
}
|
||||
FileStream strm(argv[2],"wb");
|
||||
|
||||
HttpRequest req;
|
||||
req.url = argv[1];
|
||||
HttpResponse resp(req);
|
||||
resp.CopyToStream(&strm);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user