Merged
Conversation
Contributor
|
I think this is a nice convenience and helps keep our documentation more concise with fewer non-Stripe related rabbit holes 💯 |
ob-stripe
approved these changes
Jan 28, 2020
Contributor
ob-stripe
left a comment
There was a problem hiding this comment.
LGTM!
I wonder if there's any way we can make the command more "Stripe specific", e.g. by looking for files specific to our samples and displaying some relevant information? Just food for thought for future improvements.
Collaborator
Author
|
@ob-stripe that's a good idea. I wonder if we could leverage the cli setup files we made for samples to give users additional instructions 🤔 @adreyfus-stripe what do you think? |
Collaborator
|
I like this as a first pass! Ultimately we could extend to add more serve config via .cli.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviewers
r? @ob-stripe @adreyfus-stripe
cc @stripe/dev-platform @suz-stripe @brandur-stripe
Summary
This adds a simple command to serve static files from the CLI. We'd like this for samples since a number of them have an
index.htmlfile and we've been suggested folks use the Python simple server, which may require installing the entire Python ecosystem.The command is
stripe serve(orstripe srv) which takes an optional argument that is a path to a directory. If not path is given, it serve the local folder:'.'.The command has some basic logging available to it when requests are made:
If an
index.htmlfile exists in the folder, the CLI will automatically render that. If not, it'll display a list of files in that specific directory.The command itself will continue running (and block) until the user kills it with ctrl+c.