This file includes the definition of the crow::Crow class, the crow::App and crow::SimpleApp aliases, and some macros. More...
#include <chrono>
#include <string>
#include <functional>
#include <memory>
#include <future>
#include <cstdint>
#include <type_traits>
#include <thread>
#include <condition_variable>
#include "crow/version.h"
#include "crow/settings.h"
#include "crow/logging.h"
#include "crow/utility.h"
#include "crow/routing.h"
#include "crow/middleware_context.h"
#include "crow/http_request.h"
#include "crow/http_server.h"
#include "crow/task_timer.h"
#include "crow/websocket.h"
#include "crow/compression.h"
Go to the source code of this file.
Classes | |
class | crow::Crow< Middlewares > |
The main server application class. More... | |
Namespaces | |
crow | |
The main namespace of the library. In this namespace is defined the most important classes and functions of the library. | |
Macros | |
#define | CROW_ROUTE(app, url) app.template route<crow::black_magic::get_parameter_tag(url)>(url) |
Creates a route for app using a rule. More... | |
#define | CROW_BP_ROUTE(blueprint, url) blueprint.new_rule_tagged<crow::black_magic::get_parameter_tag(url)>(url) |
Creates a route for a blueprint using a rule. More... | |
#define | CROW_WEBSOCKET_ROUTE(app, url) app.route<crow::black_magic::get_parameter_tag(url)>(url).websocket<std::remove_reference<decltype(app)>::type>(&app) |
Defines WebSocket route for app. More... | |
#define | CROW_MIDDLEWARES(app, ...) template middlewares<typename std::remove_reference<decltype(app)>::type, __VA_ARGS__>() |
Enable a Middleware for an specific route in app or blueprint. More... | |
#define | CROW_CATCHALL_ROUTE(app) app.catchall_route() |
Defines a custom catchall route for app using a custom rule. More... | |
#define | CROW_BP_CATCHALL_ROUTE(blueprint) blueprint.catchall_rule() |
Defines a custom catchall route for blueprint using a custom rule. More... | |
Typedefs | |
using | crow::ssl_context_t = asio::ssl::context |
template<typename... Middlewares> | |
using | crow::App = Crow< Middlewares... > |
Alias of Crow<Middlewares...>. Useful if you want a instance of an Crow application that require Middlewares. | |
using | crow::SimpleApp = Crow<> |
Alias of Crow<>. Useful if you want a instance of an Crow application that doesn't require of Middlewares. | |
This file includes the definition of the crow::Crow class, the crow::App and crow::SimpleApp aliases, and some macros.
In this file are defined:
#define CROW_BP_CATCHALL_ROUTE | ( | blueprint | ) | blueprint.catchall_rule() |
Defines a custom catchall route for blueprint using a custom rule.
It defines a handler when the client make a request for an undefined route in the blueprint.
#define CROW_BP_ROUTE | ( | blueprint, | |
url | |||
) | blueprint.new_rule_tagged<crow::black_magic::get_parameter_tag(url)>(url) |
Creates a route for a blueprint using a rule.
It may use crow::Blueprint::new_rule_dynamic or crow::Blueprint::new_rule_tagged to define a new rule for an given blueprint. It's usage is similar to CROW_ROUTE macro:
This is the recommended way to define routes in a crow blueprint because of its compile-time capabilities.
#define CROW_CATCHALL_ROUTE | ( | app | ) | app.catchall_route() |
Defines a custom catchall route for app using a custom rule.
It defines a handler when the client make a request for an undefined route. Instead of just reply with a 404
status code (default behavior), you can define a custom handler using this macro.
#define CROW_MIDDLEWARES | ( | app, | |
... | |||
) | template middlewares<typename std::remove_reference<decltype(app)>::type, __VA_ARGS__>() |
Enable a Middleware for an specific route in app or blueprint.
It defines the usage of a Middleware in one route. And it can be used in both crow::SimpleApp (and crow::App) instances and crow::Blueprint. Its usage syntax is like this:
#define CROW_ROUTE | ( | app, | |
url | |||
) | app.template route<crow::black_magic::get_parameter_tag(url)>(url) |
Creates a route for app using a rule.
It use crow::Crow::route_dynamic or crow::Crow::route to define a rule for your application. It's usage is like this:
This is the recommended way to define routes in a crow application.
#define CROW_WEBSOCKET_ROUTE | ( | app, | |
url | |||
) | app.route<crow::black_magic::get_parameter_tag(url)>(url).websocket<std::remove_reference<decltype(app)>::type>(&app) |
Defines WebSocket route for app.
It binds a WebSocket route to app. Easy solution to implement WebSockets in your app. The usage syntax of this macro is like this: