Server: switch to Fastify

Switch config to TOML over JSON (it's just nicer TBH)
This commit is contained in:
MotorTruck1221 2024-10-13 04:33:25 -06:00
parent deda273eda
commit 620ad25c61
No known key found for this signature in database
GPG key ID: 08F417E2B8B61EA4
20 changed files with 1373 additions and 683 deletions

16
test.js Normal file
View 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()) });