mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-06 01:10:40 +00:00
add support for files
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use actix_web::{middleware, web, App, HttpServer};
|
||||
use dotenv::dotenv;
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
@@ -10,6 +11,7 @@ mod store;
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
dotenv().ok();
|
||||
return HttpServer::new(|| {
|
||||
App::new()
|
||||
// .configure(|cfg: &mut web::ServiceConfig| {
|
||||
|
@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct Note {
|
||||
pub meta: String,
|
||||
pub contents: String,
|
||||
pub views: Option<u8>,
|
||||
pub expiration: Option<u64>,
|
||||
@@ -14,6 +15,7 @@ pub struct NoteInfo {}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
pub struct NotePublic {
|
||||
pub meta: String,
|
||||
pub contents: String,
|
||||
}
|
||||
|
||||
|
@@ -96,6 +96,7 @@ async fn delete(path: web::Path<NotePath>) -> impl Responder {
|
||||
}
|
||||
return HttpResponse::Ok().json(NotePublic {
|
||||
contents: changed.contents,
|
||||
meta: changed.meta,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user