This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate actix_web; | |
extern crate serde; | |
extern crate futures; | |
#[macro_use] | |
extern crate serde_derive; | |
mod activitypub; | |
use activitypub::{ Object }; | |
use actix_web::{ | |
http, server, Json, App, HttpResponse, Responder | |
}; | |
fn inbox(activity: Json<Object>) -> impl Responder { | |
println!("{:?}", activity.0); | |
HttpResponse::Ok() | |
} | |
fn main() { | |
server::new( | |
|| App::new() | |
.resource("/inbox", |r| { | |
r.method(http::Method::POST) | |
.with(inbox); | |
})) | |
.bind("0.0.0.0:1150").unwrap() | |
.run() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment