user addable

This commit is contained in:
2022-12-03 15:06:32 +01:00
parent 3256c7f5fe
commit 5b95621d04
5 changed files with 41 additions and 12 deletions
+8 -10
View File
@@ -1,4 +1,3 @@
#[macro_use]
extern crate diesel;
extern crate dotenv;
@@ -7,6 +6,9 @@ use actix_web::{App, HttpResponse, HttpServer};
use env_logger;
use futures::future::{ok, Either};
use log;
mod auth;
mod database;
mod json_serialization;
mod models;
mod reader;
mod schema;
@@ -15,14 +17,6 @@ mod views;
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
env_logger::init();
// let feed: String = String::from("https://www.heise.de/rss/heise.rdf");
// let channel: Channel = get_feed(&feed).await?;
// for item in channel.items {
// println!("{:?}", item.guid().unwrap());
// }
// Ok(())
HttpServer::new(|| {
let app = App::new()
@@ -30,8 +24,12 @@ async fn main() -> std::io::Result<()> {
let passed: bool;
let request_url: String = String::from(req.uri().path().clone());
log::info!("Request Url: {}", request_url);
if req.path().contains("/reader/") {
todo!("implement");
match auth::process_token(&req) {
Ok(_token) => passed = true,
Err(_message) => passed = false,
}
} else {
passed = true;
}