Skip to content

Add default style to CLI argument - #38

Open
buma wants to merge 3 commits into
consbio:mainfrom
buma:defaultStyles
Open

Add default style to CLI argument#38
buma wants to merge 3 commits into
consbio:mainfrom
buma:defaultStyles

Conversation

@buma

@buma buma commented Oct 29, 2019

Copy link
Copy Markdown

Style can be provided in request as a string or as argument when starting server.

Style can be provided in request or as argument when starting Server
@brendan-ward

Copy link
Copy Markdown
Collaborator

@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.

@brendan-ward brendan-ward left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread src/server.js Outdated
Comment thread src/server.js Outdated
} else if (typeof default_styles === 'string') {
try {
// read styleJSON
const data = fs.readFileSync(default_styles, "utf8")

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Author

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.

Comment thread src/server.js Outdated
@buma

buma commented Nov 3, 2019

Copy link
Copy Markdown
Author

Usage case is to specify style when you start the server and you don't need to sent it on each request.
Example: node dist/server.js -s /styles/klokantech-basic-gl-style/style-local.json
I'm not sure if style sent with request should override default style or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants