From 3135e33301999ac4aa30db54e68d038316ab46cb Mon Sep 17 00:00:00 2001 From: 0ceanSlim Date: Tue, 16 Apr 2024 11:33:11 -0400 Subject: [PATCH] changed port for upload server, readme update --- .nip05Storage/oceanslim/merge.png | Bin 0 -> 11159 bytes index.js | 2 +- readme.md | 18 ++++++++++++------ server.js | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 .nip05Storage/oceanslim/merge.png diff --git a/.nip05Storage/oceanslim/merge.png b/.nip05Storage/oceanslim/merge.png new file mode 100644 index 0000000000000000000000000000000000000000..c9270a71e2f40ddbe914742031d861888d879d52 GIT binary patch literal 11159 zcmeHtRaBI17~qEm2*MyrBMd1mEsdmzfJ2v{)DQyF0@B^xT~gBBC?Vb5-HmkZH{icF zyBB-07kjaX!(n(j-+12f`5-O+oUUtfbPA7$Q$`@6Wa->;R?ep`2{`_Hh<8m5_Wp**Bz&e!lI<%b6&(V z8U-IECQd$>D7b`^`jXP7dV9Mn*u1QKCj30D%M~TdS&-Rcm#f0}p6~CcB2-8*tN8ej zS5dz<)X6A7@jPjF@+^+WS1(4+mDFifM(S3#3XZvMW_X_617z9*RHuIz4K03u3IGsw z{8l-qHXqehogS|=Yczf=06-z)+W*^|fnua9;xL1T8*vjV1G;pt>7z&Xt|Zbqk5KB>wNXC=0IJTy zNh@7tlGscD`1Aw4;Y+x$nCA*e8Qt=nAS2*Ow;agiX2kZ6kPtyKXG+lj()f#h;yu9G z$v{4>v?#?Ej5L45=Zc^0!3e%nSx+g`@Bv;>c1c?@?A_rr0O%q`3y{5IFCKfDf#A5N z%>4(F!?(8h=*cF71PD^6hhOK$fND(=SHuQv4x|9U*@orIwHOV;j6OnK!i-xw8D9N6 z4Oe^VcN*BjK64uDzC|dT5_G$x-&6KHXM1OWFqKpPpW2;Nv$Sx8nU!86|MZ8V*PLnG z>LCu8=k_?` z^{HA^k5tTB007TBFkrwQIUkadt;#%>^ZX=2eh>_^^NQ#nF@rdf47|d5C}DSD zp7UhR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5!gx@hyY-&ZyT(t;xGDL8nM zPbd-pA&!{62y?RK;?+z#rE=It8R1u$&4M>y%Ly&x1cLZ6l}A%lA#cA+nS8`qX+vDC zy(An+MNhRf=+8{iJCj@N#cUZmHqDD``307)DNsTxSqSBWM3>(b&cab15r^#NH>4f^ zju+aX#M6>Jiz?=ewd5r6C#)B3q^Z;ifrVcaA#rr}OE33)e;p{{uPJR!N z@;xiFbt%qv4;=Bc9nEy6zzdy!R>`vAkfM^UN4ArwDrEAA7b3BsHeo@X;4IyGSvLwSt-eE(>DH!Wk=0AVDx6mWup?tnH0QaHq?Z>z?9S5yKUf@p%(JI7 zcQtzojkV&HZJwYXy<*5$1Cs1$GyBe+7_{3-SRVk5NBUPkuSU)Ns&H~%t@=aF=|i0A zTJY8Iw6Rk4HZO)uzpCkeu?-0fyP2FE=Y6errK(us)V7TdbbAnJBOYR3YX=h8r)KXP z(&vzbNe>0V{D)EYeYu$A)RM?^vKE@Tx_@zPJ4DFE<>yNGhBf#|eTcisne7_VMz<}R z&ak#Iz?ZqEXDXUgG!X~-h}jjhnI!{08lvagQ_%e>RW?i}Sd6!cK3Ys`L mUu5$03m#`L@~`JNBu59R53FO)!7rTvfP|>DNWRb~*Z%?9XfuHT literal 0 HcmV?d00001 diff --git a/index.js b/index.js index f363f42..597d33b 100644 --- a/index.js +++ b/index.js @@ -94,7 +94,7 @@ function handleFileSelect(event) { console.log("Selected file:", selectedFile); } -const serverUrl = "http://localhost:3000"; // Adjust the port as needed +const serverUrl = "http://localhost:34537"; // Adjust the port as needed async function handleUpload() { const fileInput = document.querySelector('input[type="file"]'); diff --git a/readme.md b/readme.md index 691908f..ea0b7b3 100644 --- a/readme.md +++ b/readme.md @@ -13,6 +13,7 @@ run the dev server: `vite` listen for uploads (run backend server) +THIS IS CURRENTLY HARDCODED TO RUN ON PORT 34537 `node server` go to http://localhost:5173 @@ -21,19 +22,24 @@ check out the console (right click inspect) TODO: Check for security make sure I can't get around it some easy way at least. new npub with proper nip05 and username access? + +grab preferred relays from nip (notepress has an example in setup.js) instead of using an explicit one. + +Create directory for a user it doesn't already exist. UI think upload will fail right now if the user doesn't already have a directory + +need provisions to catch if the user is uploading a file with the same name as a file already in their storage, ask to replace or rename the new file + +config for max file size and default storage limit for a given user + +can make a exceptions later to allow more storage for a user based on criterea + create a setup that runs both frontend and backend code and make a config file for any configs for the user -set up create path if it doesn't exist for a new user. -config for max file size and default storage limit for a given iser -can make a exceptions later to allow more storage for a user based on criterea - the .well-known and .nip05Storage are for testing purposed right now. they will be removed later. redo readme -get rid of cors errors? - make favicon test on my site diff --git a/server.js b/server.js index d645172..dae06ff 100644 --- a/server.js +++ b/server.js @@ -26,8 +26,8 @@ const storage = multer.diskStorage({ const upload = multer({ storage: storage }); -app.listen(3000, () => { - console.log("Server is running on port 3000"); +app.listen(34537, () => { + console.log("Server is running on port 34537"); }); app.post("/upload", upload.single("file"), (req, res) => {