Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

buma
Copy link

@buma buma commented Oct 29, 2019

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

Copy link
Collaborator

@brendan-ward brendan-ward left a 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 Show resolved Hide resolved
src/server.js Outdated
} else if (typeof default_styles === 'string') {
try {
// read styleJSON
const data = fs.readFileSync(default_styles, "utf8")
Copy link
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
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.

src/server.js Outdated Show resolved Hide resolved
@buma
Copy link
Author

buma commented Nov 3, 2019

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