Image upload API

This commit is contained in:
rift 2024-08-20 19:38:43 -05:00
parent 52d47b4247
commit 948611f434
11 changed files with 193 additions and 4 deletions

10
test_upload.js Normal file
View file

@ -0,0 +1,10 @@
// This is a test file to upload files to the Nebula server
import { FormData, File } from "formdata-node";
import { fileFromPath } from "formdata-node/file-from-path";
const form = new FormData();
// const file = new File(["My hovercraft is full of eels"], "example.txt");
form.set("file", await fileFromPath("asgard.png"));
await fetch("http://localhost:8080/upload", { method: "post", body: form });