mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 03:50:02 -04:00
Image upload API
This commit is contained in:
parent
52d47b4247
commit
948611f434
11 changed files with 193 additions and 4 deletions
10
test_upload.js
Normal file
10
test_upload.js
Normal 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 });
|
Loading…
Add table
Add a link
Reference in a new issue