Skip to content

Commit 08bd242

Browse files
author
Simon Heumos
authored
Merge pull request #95 from vgteam/server
`odgi server` gets the capability to handle GET requests of complex path names like '5-' or '1741.hr2'.
2 parents d31ed1b + 1272c15 commit 08bd242

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/subcommand/server_main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ namespace odgi {
6868
6969
// const char* pattern1 = R"(/(\w+)/(\d+))";
7070
// const char* pattern1 = R"(/([a-zA-Z]*[0-9]*)/(\d+))";
71-
const char* pattern1 = R"(/(\w*)/(\d+))";
71+
const char* pattern1 = R"(/(\w*.*)/(\d+))";
7272
std::regex regexi1 = std::regex(pattern1);
7373
std::cmatch cm1; // same as std::match_results<const char*> cm;
74-
std::regex_match ("/5-/3",cm1,regexi1);
74+
std::regex_match ("/5-/3",cm1,regexi1); // /1741.hr2/3
7575
std::cout << "the matches were: " << std::endl;
7676
for (unsigned i=0; i<cm1.size(); ++i) {
7777
std::cout << "[" << cm1[i] << "] " << std::endl;
@@ -88,7 +88,7 @@ namespace odgi {
8888
std::cout << "GOT REQUEST : HELLO WORLD!" << std::endl;
8989
});
9090

91-
svr.Get(R"(/(\w*)/(\d+))", [&](const Request& req, Response& res) {
91+
svr.Get(R"(/(\w*.*)/(\d+))", [&](const Request& req, Response& res) {
9292
/*
9393
for (size_t i = 0; i < req.matches.size(); i++) {
9494
std::cout << req.matches[i] << std::endl;

0 commit comments

Comments
 (0)