mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 03:50:02 -04:00
Server: switch to Fastify
Switch config to TOML over JSON (it's just nicer TBH)
This commit is contained in:
parent
deda273eda
commit
620ad25c61
20 changed files with 1373 additions and 683 deletions
16
test.js
Normal file
16
test.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import fs from "fs";
|
||||
// This is a test file to upload files to the Nebula server
|
||||
import { File, FormData } from "formdata-node";
|
||||
import { fileFromPath } from "formdata-node/file-from-path";
|
||||
import { parsedDoc } from "./server/config.js";
|
||||
const form = new FormData();
|
||||
const file = new File(["My hovercraft is full of eels"], "example.txt");
|
||||
form.set("file", file);
|
||||
console.log(form);
|
||||
await fetch("http://localhost:8080/api/upload-image", {
|
||||
headers: {
|
||||
PSK: parsedDoc.marketplace.psk
|
||||
},
|
||||
method: "post",
|
||||
body: form
|
||||
}).then(async (res) => { console.log(await res.text()) });
|
Loading…
Add table
Add a link
Reference in a new issue