1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00

use cors and identity crates

This commit is contained in:
Nikolay Kim 2019-06-17 12:48:03 +06:00
parent c8467d1ffd
commit e7ed6755a5
9 changed files with 13 additions and 14 deletions

View File

@ -3,7 +3,6 @@
A curated list of examples related to actix.
## from community
* [RutHub](https://www.ruthub.com/): A service for sharing read list powered by actix-web + diesel, [repo](https://github.com/danloh/rut-server-rust).
* [OUISRC](http://ouisrc.xyz/) : Welcome to OUISRC, let us Gain more in exploration and interaction.
* [Roseline](https://github.com/DoumanAsh/roseline.rs) : A personal web site and discord & IRC bot to access simple SQLite database. Demonstrates usage of various actix and actix-web concepts.
* [Actix Auth Server](https://hgill.io/posts/auth-microservice-rust-actix-web-diesel-complete-tutorial-part-1/) : Auth web micro-service with rust using actix-web - complete tutorial. See code in [examples/simple-auth-server](https://github.com/actix/examples/tree/master/simple-auth-server)

View File

@ -7,4 +7,5 @@ workspace = ".."
[dependencies]
actix-web = "1.0.0"
actix-identity = "0.1.0"
env_logger = "0.6"

View File

@ -1,5 +1,5 @@
use actix_web::middleware::identity::Identity;
use actix_web::middleware::identity::{CookieIdentityPolicy, IdentityService};
use actix_identity::Identity;
use actix_identity::{CookieIdentityPolicy, IdentityService};
use actix_web::{middleware, web, App, HttpResponse, HttpServer};
fn index(id: Identity) -> String {

View File

@ -8,8 +8,9 @@ workspace = ".."
[dependencies]
actix = "0.8.2"
actix-rt = "0.2.2"
actix-web = "1.0.0"
actix-web = "1.0.2"
actix-files = "0.1.1"
actix-identity= "0.1.0"
bcrypt = "0.2.1"
chrono = { version = "0.4.6", features = ["serde"] }

View File

@ -1,6 +1,6 @@
use actix::{Handler, Message};
use actix_web::{dev::Payload, Error, HttpRequest};
use actix_web::{middleware::identity::Identity, FromRequest};
use actix_web::{dev::Payload, Error, HttpRequest, FromRequest};
use actix_identity::Identity;
use bcrypt::verify;
use diesel::prelude::*;

View File

@ -1,5 +1,5 @@
use actix::Addr;
use actix_web::middleware::identity::Identity;
use actix_identity::Identity;
use actix_web::{web, Error, HttpRequest, HttpResponse, Responder, ResponseError};
use futures::Future;

View File

@ -7,10 +7,8 @@ extern crate serde_derive;
use actix::prelude::*;
use actix_files as fs;
use actix_web::middleware::{
identity::{CookieIdentityPolicy, IdentityService},
Logger,
};
use actix_identity::{CookieIdentityPolicy, IdentityService};
use actix_web::middleware::Logger;
use actix_web::{web, App, HttpServer};
use chrono::Duration;
use diesel::{r2d2::ConnectionManager, PgConnection};

View File

@ -7,6 +7,7 @@ edition = "2018"
[dependencies]
actix-web = "1.0.0"
actix-cors = "0.1.0"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"

View File

@ -1,9 +1,8 @@
#[macro_use]
extern crate serde_derive;
use actix_web::{
http::header, middleware::cors::Cors, middleware::Logger, web, App, HttpServer,
};
use actix_cors::Cors;
use actix_web::{http::header, middleware::Logger, web, App, HttpServer};
mod user;