fediglam/src/main/controllers/api/drive.zig

18 lines
396 B
Zig
Raw Normal View History

2022-12-03 07:44:27 +00:00
pub const http = @import("http");
pub const upload = struct {
pub const method = .POST;
pub const path = "/drive/:path*";
pub const Body = struct {
file: http.FormFile,
};
pub fn handler(req: anytype, res: anytype, srv: anytype) !void {
const f = req.body.file;
try srv.uploadFile(f.filename, f.data);
try res.json(.created, .{});
}
};