updates
This commit is contained in:
parent
a4a5d580f6
commit
16688ac679
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
# Build directories
|
||||
build/
|
||||
.cache
|
||||
|
||||
# Executables
|
||||
*.out
|
||||
|
4
main.cpp
4
main.cpp
@ -42,8 +42,8 @@ int main() {
|
||||
});
|
||||
|
||||
router.post("/users", [](const Request& req, Response& res) {
|
||||
std::string body_preview = std::string(req.body.substr(0, 100));
|
||||
res.set_json("{\"message\":\"User created\",\"received\":\"" + body_preview + "\"}");
|
||||
const auto body_preview = std::string(req.body.substr(0, 100));
|
||||
res.set_json(R"({"message":"User created","received":")" + body_preview + "\"}");
|
||||
res.status = 201;
|
||||
});
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "request.hpp"
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <string_view>
|
||||
#include <memory>
|
||||
|
Loading…
x
Reference in New Issue
Block a user