Database pool working

This commit is contained in:
2021-05-17 22:49:43 +02:00
parent 338e1c060e
commit 1c29a865aa
4 changed files with 132 additions and 52 deletions

View File

@ -3,6 +3,8 @@ use crate::usimp;
use crate::websocket;
use chrono;
use json;
use std::sync::{Arc, Mutex};
use std::borrow::Borrow;
pub struct HttpStream {
pub stream: super::Stream,
@ -157,7 +159,7 @@ fn endpoint_handler(
let output = usimp::endpoint(endpoint, input);
// TODO compress
let buf = output.to_string() + "\r\n";
let buf = json::stringify(output) + "\r\n";
let length = buf.as_bytes().len();
res.add_header("Content-Length", length.to_string().as_str());
res.add_header("Content-Type", "application/json; charset=utf-8");