-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add default style to CLI argument #38
base: main
Are you sure you want to change the base?
Conversation
Style can be provided in request or as argument when starting Server
@buma Thank you for contributing this! Can you please add an example usage in comments here, or to the README? I want to make sure I understand the flow you have in mind from a usage perspective. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@buma a few minor tweaks to make, plus we need a bit more information about usage - a working example or two would be particularly helpful.
src/server.js
Outdated
} else if (typeof default_styles === 'string') { | ||
try { | ||
// read styleJSON | ||
const data = fs.readFileSync(default_styles, "utf8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? Your usage below for the command line interface suggests a directory of default style files, whereas here we are treating it as a path to a specific style JSON file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated usage now. Path to specific style JSON is needed.
Usage case is to specify style when you start the server and you don't need to sent it on each request. |
Style can be provided in request as a string or as argument when starting server.