user addable
parent
3256c7f5fe
commit
5b95621d04
|
@ -1,7 +1,7 @@
|
||||||
version: "3.7"
|
version: "3.7"
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
container_name: 'to-do-postgres'
|
container_name: 'rss-postgres'
|
||||||
image: 'postgres:latest'
|
image: 'postgres:latest'
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
|
18
src/main.rs
18
src/main.rs
|
@ -1,4 +1,3 @@
|
||||||
#[macro_use]
|
|
||||||
extern crate diesel;
|
extern crate diesel;
|
||||||
extern crate dotenv;
|
extern crate dotenv;
|
||||||
|
|
||||||
|
@ -7,6 +6,9 @@ use actix_web::{App, HttpResponse, HttpServer};
|
||||||
use env_logger;
|
use env_logger;
|
||||||
use futures::future::{ok, Either};
|
use futures::future::{ok, Either};
|
||||||
use log;
|
use log;
|
||||||
|
mod auth;
|
||||||
|
mod database;
|
||||||
|
mod json_serialization;
|
||||||
mod models;
|
mod models;
|
||||||
mod reader;
|
mod reader;
|
||||||
mod schema;
|
mod schema;
|
||||||
|
@ -15,14 +17,6 @@ mod views;
|
||||||
#[actix_rt::main]
|
#[actix_rt::main]
|
||||||
async fn main() -> std::io::Result<()> {
|
async fn main() -> std::io::Result<()> {
|
||||||
env_logger::init();
|
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(|| {
|
HttpServer::new(|| {
|
||||||
let app = App::new()
|
let app = App::new()
|
||||||
|
@ -30,8 +24,12 @@ async fn main() -> std::io::Result<()> {
|
||||||
let passed: bool;
|
let passed: bool;
|
||||||
let request_url: String = String::from(req.uri().path().clone());
|
let request_url: String = String::from(req.uri().path().clone());
|
||||||
|
|
||||||
|
log::info!("Request Url: {}", request_url);
|
||||||
if req.path().contains("/reader/") {
|
if req.path().contains("/reader/") {
|
||||||
todo!("implement");
|
match auth::process_token(&req) {
|
||||||
|
Ok(_token) => passed = true,
|
||||||
|
Err(_message) => passed = false,
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
passed = true;
|
passed = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
pub mod feed;
|
||||||
|
pub mod feed_item;
|
||||||
pub mod user;
|
pub mod user;
|
||||||
|
|
|
@ -1,5 +1,23 @@
|
||||||
// @generated automatically by Diesel CLI.
|
// @generated automatically by Diesel CLI.
|
||||||
|
|
||||||
|
diesel::table! {
|
||||||
|
feed (id) {
|
||||||
|
id -> Int4,
|
||||||
|
user_id -> Int4,
|
||||||
|
title -> Varchar,
|
||||||
|
url -> Varchar,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diesel::table! {
|
||||||
|
feed_item (id) {
|
||||||
|
id -> Int4,
|
||||||
|
feed_id -> Int4,
|
||||||
|
content -> Text,
|
||||||
|
read -> Bool,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
diesel::table! {
|
diesel::table! {
|
||||||
users (id) {
|
users (id) {
|
||||||
id -> Int4,
|
id -> Int4,
|
||||||
|
@ -9,3 +27,12 @@ diesel::table! {
|
||||||
unique_id -> Varchar,
|
unique_id -> Varchar,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diesel::joinable!(feed -> users (user_id));
|
||||||
|
diesel::joinable!(feed_item -> feed (feed_id));
|
||||||
|
|
||||||
|
diesel::allow_tables_to_appear_in_same_query!(
|
||||||
|
feed,
|
||||||
|
feed_item,
|
||||||
|
users,
|
||||||
|
);
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use actix_web::web;
|
use actix_web::web;
|
||||||
|
pub(crate) mod path;
|
||||||
|
mod users;
|
||||||
|
|
||||||
pub fn views_factory(app: &mut web::ServiceConfig) {
|
pub fn views_factory(app: &mut web::ServiceConfig) {
|
||||||
// auth::auth_factory(app);
|
// auth::auth_factory(app);
|
||||||
// to_do::item_factory(app);
|
// to_do::item_factory(app);
|
||||||
// app::app_factory(app);
|
// app::app_factory(app);
|
||||||
// users::user_factory(app);
|
users::user_factory(app);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue