i wanna use a reverse proxy anyways

This commit is contained in:
Leonard Lorenz 2020-10-23 01:03:59 +02:00
parent e69dc686f0
commit 19080cc0e7
5 changed files with 2 additions and 64 deletions

View file

@ -24,11 +24,11 @@ pub fn get_posts() -> std::vec::Vec<Post> {
.expect("Error, couldn't load posts.")
}
pub fn get_post_by_id(id: i32) -> Post {
pub fn get_post_by_id(_id: i32) -> Post {
use crate::db::schema::posts::dsl::*;
let connection = establish_connection();
posts
.find(id)
.find(_id)
.get_result(&connection)
.expect("Error, couldn't find post")
}

View file

@ -11,25 +11,11 @@ extern crate tera;
use actix_files as fs;
use actix_web::{App, HttpServer};
use config::get_from_env;
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
let root_path = get_from_env("ROOT_PATH", true);
let mut builder = SslAcceptor::mozilla_intermediate(SslMethod::tls()).unwrap();
builder
.set_private_key_file(
get_from_env("SSL_PATH", true) + &get_from_env("SSL_PRIV_NAME", true),
SslFiletype::PEM,
)
.unwrap();
builder
.set_certificate_chain_file(
get_from_env("SSL_PATH", true) + &get_from_env("SSL_CERT_NAME", true),
)
.unwrap();
App::new()
//.wrap(middleware::NormalizePath::default())