Added a session id.
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/main.rs
									
									
									
									
									
								
							@@ -1,4 +1,8 @@
 | 
			
		||||
use tide::{http::StatusCode, Request, Response};
 | 
			
		||||
use tide::{
 | 
			
		||||
    http::StatusCode,
 | 
			
		||||
    sessions::{MemoryStore, SessionMiddleware},
 | 
			
		||||
    Request, Response,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
mod settings;
 | 
			
		||||
 | 
			
		||||
@@ -16,6 +20,10 @@ async fn main() -> tide::Result<()> {
 | 
			
		||||
async fn app_setup() -> tide::Server<()> {
 | 
			
		||||
    let mut app = tide::new();
 | 
			
		||||
    app.at("/").get(home);
 | 
			
		||||
    app.with(SessionMiddleware::new(
 | 
			
		||||
        MemoryStore::new(),
 | 
			
		||||
        b"361f953f-56ba-45e6-86ab-9efbf61b745d",
 | 
			
		||||
    ));
 | 
			
		||||
    return app;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user