added color output in terminal

This commit is contained in:
wt committed 2024-05-30 15:43:37 +07:00
1 parent e7ca69aff1
commit ad94b4d194
11 files changed
+100 -1

No files matched your search

+2
View File
@@ -1,4 +1,5 @@
#include "users.hpp"
#include "../colors.h"
#define ALPHABET "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
@@ -14,6 +15,7 @@ std::string get_random_string(const char *alphabet, int quantity) {
// function for add user
void add_user(const httplib::Request& request, httplib::Response& response) {
std::cout << GREEN << request.path << RESET << " " << request.method << std::endl;
response.set_header("Access-Control-Allow-Origin", "*");
if (request.body == "") {response.set_content("{\"required\":\"[token,username,password]\",\"optional\":\"[group,is_superuser]\"}", "application/json");return;}
nlohmann::json json_body = nlohmann::json::parse(request.body);