mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
46 lines
671 B
C++
46 lines
671 B
C++
#pragma once
|
|
#include <string>
|
|
#include <functional>
|
|
#include <memory>
|
|
#include <future>
|
|
#include <stdint.h>
|
|
|
|
#include "http_server.h"
|
|
|
|
// TEST
|
|
#include <iostream>
|
|
|
|
namespace flask
|
|
{
|
|
class Flask
|
|
{
|
|
public:
|
|
Flask()
|
|
{
|
|
}
|
|
|
|
void handle()
|
|
{
|
|
}
|
|
|
|
void route(const std::string& url, std::function<std::string()> f)
|
|
{
|
|
}
|
|
|
|
Flask& port(std::uint16_t port)
|
|
{
|
|
port_ = port;
|
|
return *this;
|
|
}
|
|
|
|
void run()
|
|
{
|
|
Server<Flask> server(this, port_);
|
|
server.run();
|
|
}
|
|
private:
|
|
uint16_t port_ = 80;
|
|
};
|
|
};
|
|
|