user addable
parent
3256c7f5fe
commit
5b95621d04
|
@ -1,7 +1,7 @@
|
|||
version: "3.7"
|
||||
services:
|
||||
postgres:
|
||||
container_name: 'to-do-postgres'
|
||||
container_name: 'rss-postgres'
|
||||
image: 'postgres:latest'
|
||||
restart: always
|
||||
ports:
|
||||
|
|
18
src/main.rs
18
src/main.rs
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
pub mod feed;
|
||||
pub mod feed_item;
|
||||
pub mod user;
|
||||
|
|
|
@ -1,5 +1,23 @@
|
|||
// @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! {
|
||||
users (id) {
|
||||
id -> Int4,
|
||||
|
@ -9,3 +27,12 @@ diesel::table! {
|
|||
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;
|
||||
pub(crate) mod path;
|
||||
mod users;
|
||||
|
||||
pub fn views_factory(app: &mut web::ServiceConfig) {
|
||||
// auth::auth_factory(app);
|
||||
// to_do::item_factory(app);
|
||||
// app::app_factory(app);
|
||||
// users::user_factory(app);
|
||||
users::user_factory(app);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue