cli
cli copied to clipboard
chore(deps): remove usage of the static-server dependency
We use static-server to simulate a static server a part of the ntl dev
command.
About 2 months ago it was deprecated and repo archived, see https://github.com/nbluis/static-server/blob/84999917193f664c205efd587934bc6ea361fa78/README.md.
~~We should replace it with another package, possible https://expressjs.com/en/starter/static-files.html as we already have express
as a dependency.~~
See comment: https://github.com/netlify/cli/issues/4511#issuecomment-1087635077
@erezrokah hey! Can I work on that?
Instead of express use fastify as it is even faster than node native http (it performs some optimizations).
There is the fastify static plugin as well should be relatively straight forward: https://github.com/fastify/fastify-static
@simonepelosi for sure you can work on that! If you need some guidance regarding testing or something else please don't hesitate to reach out to us!
@lukasholzer thank you!
Sure thing @simonepelosi! Thank you 🥳
https://github.com/netlify/cli/blob/3df8f95a1f92fef41dc5c43d79b99551cf6f2bad/src/commands/dev/dev.js#L10 is a good place to start
Thank you @erezrokah !
@lukasholzer How can I test my changes?
P.S. I'm running tests with npm run test:dev and I got some problems with the 404 redirect with Fastify
@lukasholzer @simonepelosi - any progress on this? Noticed this is a security issue, and we try to make sure those don't go dormant. Cheers
Instead of express use fastify as it is even faster than node native http (it performs some optimizations).
@lukasholzer I was thinking of picking this issue up but I'm slightly opposed to using fastify instead of express because it would require adding 2 more dependencies (fastify
& fastify/static
) to the repository when express is already a dependency in the repo. WDYT?
@tinfoil-knight I meant replacing express with fastify so we should get rid of express