-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make our launch_static_server
script runnable as a script
#1654
Conversation
408387d
to
56dec10
Compare
Automated performance checks have been performed on commit Tests results✅ Tests have passed. Performance tests 1st run outputNo significative change in performance for tests:
If you want to skip performance checks for latter commits, add the |
56dec10
to
d1b7087
Compare
Automated performance checks have been performed on commit Tests results✅ Tests have passed. Performance tests 1st run outputNo significative change in performance for tests:
If you want to skip performance checks for latter commits, add the |
I wanted today to run an HTTPS server serving local files quickly to test something only locally. What I do normally was to rely on rely on the `http-server` npm package, which may be the better way, but I always forget the syntax wanted to provide my certificate and key file (my self-signed ones for localhost). We also have a much simpler `launch_static_server.mjs` script which does that, and which has the main advantage that we're more used to it, as we use it to run tests, our demo locally and so on. But that file was only exported as an ES6 module and not as a script. Consequently it only worked if imported and ran from another JS file, but not by running directly through node.js. Moreover, I know that @FlorentBouisset had the same need two days ago. So I thought it could in the end also run as a script. The main ""difficulty"" is here to process flags but we already do that in a variety of other scripts, so it was quick to add. I could do my tests.... under I'll admit a little more time than if I just did a `npx http-server --help`, but where's the fun in that?
d1b7087
to
ad37243
Compare
Automated performance checks have been performed on commit Tests results✅ Tests have passed. Performance tests 1st run outputNo significative change in performance for tests:
If you want to skip performance checks for latter commits, add the |
I wanted today to run an HTTPS server serving local files quickly to test something only locally.
What I did normally was to rely on the
http-server
npm package, which may be the better way, but I always forget the syntax wanted to provide my TLS certificate and key files (my self-signed ones for localhost).We also have a much simpler
launch_static_server.mjs
script which does that, and which has the main advantage that we're more used to it, as we use it to run tests, our demo locally and so on.But that file was only exported as an ES6 module and not as a script. Consequently it only worked if imported and ran from another JS file, but not by running it directly through node.js.
Moreover, I know that @Florent-Bouisset had the same need two days ago.
So I thought it could in the end also run as a script. The main ""difficulty"" is here to process flags but we already do that in a variety of other scripts, so it was quick to add.
I could do my tests.... under I'll admit a little more time than if I just did a
npx http-server --help
, but where's the fun in that?