#pragma once #include "Route.h" #include #include namespace VWeb { typedef std::function RouteFunction; class Router { public: Router(); void AddRoute(const std::string &name, const Ref &route); Ref &GetRoute(const std::string &name); void DeleteRoute(const std::string &name); Ref HandleRoute(Ref &request); Ref FindRoute(Ref &request); static void AddToArgs(Ref &request, std::vector &items); public: void Get(const std::string &path, RouteFunction); void Post(const std::string &path, RouteFunction); void Put(const std::string &path, RouteFunction); void Patch(const std::string &path, RouteFunction); void Delete(const std::string &path, RouteFunction); std::unordered_map> m_Routes; }; } // namespace VWeb