Closed karimfromjordan closed 1 year ago
one thing i noticed is that requires node 18 because of the fromweb method. is there a way around that? if no or not easy we should at least note this in the readme
one thing i noticed is that requires node 18 because of the fromweb method. is there a way around that? if no or not easy we should at least note this in the readme
Yes, true I should have added that to the README. It works with Node.js >=17.0.0. There is a manual way to deal with this but it's supposed to be more complex and I haven't found a good explanation for that.
Edit: I saw I actually already added it to the README at the bottom but will move it up to the top.
One thing I haven't done yet (feel free to do it if necessary) is split the examples into svelte
and sveltekit
sub directories.
yeah let's do that in a follow-up PR. To not have too much nesting, we should probably do that at the top level
Ok, I just made a few last minor improvements but I'm done now.
Nice! One last question: Do we need the S3-variables to be part of the dynamic env imports or can it be imported from the static ones, too?
Good question. I would say they should be dynamic. There is one public static env var used on the page and the ones used on the backend are dynamic. My idea was that when you build the project and deploy it to a container you can inject the env vars at runtime with systemd, Docker etc. These variables are also sensible. The env var used on the page is imported from static.
Should I create a PR where we move the folders — into a svelte
and sveltekit
directory at the top level? The sveltekit-
prefix of the file upload examples can then be stripped. Would the counters
example be a svelte
or sveltekit
example?
Let's take this discussion to Discord so other maintainers can chime in
The previous two PRs #6 and #7 were deleted because I merged the two branches and cleaned up a few things. So this branch contains two projects — one for plain Node.js and for S3. It covers what was discussed in the file uploads issue #2
Unfortunately, POST requests with SvelteKit do not work in Stackblitz so the only way to test these examples is to clone them. The CSS is very basic and mostly handles layout for now. Functionality-wise it probably does everything you would from such an example. The only thing that is kinda missing is a place where possible errors get displayed although the only error that can really happen is that a file with the same name is uploaded again, in which case currently the request is rejected in the Node.js example and nothing happens.