deno.land / x / abc@v1.3.3 / examples / file_upload / main.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import type { FormFile } from "../../vendor/https/deno.land/std/mime/multipart.ts";import { Application } from "../../mod.ts";
const decoder = new TextDecoder();
const app = new Application();
app.start({ port: 8080 });
console.log(`server listening on http://localhost:8080`);
app.post("/file", async (c) => { const { file } = await c.body as { file: FormFile }; return { name: file.filename, content: decoder.decode(file.content), };});
abc

Version Info

Tagged at
4 years ago