mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-05 17:00:39 +00:00
docker
This commit is contained in:
@@ -13,12 +13,11 @@ async fn main() -> std::io::Result<()> {
|
||||
App::new()
|
||||
.wrap(middleware::Compress::default())
|
||||
.wrap(middleware::DefaultHeaders::default())
|
||||
// .wrap(middleware::NormalizePath::default())
|
||||
.configure(note::init)
|
||||
.configure(client::init)
|
||||
.default_service(web::resource("").route(web::get().to(client::fallback_fn)))
|
||||
})
|
||||
.bind("127.0.0.1:5000")?
|
||||
.bind("0.0.0.0:5000")?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
@@ -3,8 +3,11 @@ use memcache;
|
||||
use crate::note::Note;
|
||||
|
||||
lazy_static! {
|
||||
static ref CLIENT: memcache::Client =
|
||||
memcache::connect("memcache://127.0.0.1:11211?timeout=10&tcp_nodelay=true").unwrap();
|
||||
static ref CLIENT: memcache::Client = memcache::connect(format!(
|
||||
"memcache://{}?timeout=10&tcp_nodelay=true",
|
||||
std::env::var("MEMCACHE").unwrap_or("127.0.0.1:11211".to_string())
|
||||
))
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pub fn set(id: &String, note: &Note) {
|
||||
|
Reference in New Issue
Block a user