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

server settings api #141

Closed
jasonkuhrt opened this issue Dec 8, 2019 · 2 comments
Closed

server settings api #141

jasonkuhrt opened this issue Dec 8, 2019 · 2 comments
Labels
scope/server Related to the server component type/feat Add a new capability or enhance an existing one type/improve Something existing is made better, does not affect the interface (example: better error message)

Comments

@jasonkuhrt
Copy link
Member

Once #133 lands it means that there is less reason for users to manually run start. One reason that will remain however is if they wish to pass custom configuration to the server. e.g.:

app.server.start({ port: '1234' })

We should have a more gradual api that doesn't force the user to take on start just because they want to configure something. e.g.:

app.server.configure({ port: '1234' })
@jasonkuhrt jasonkuhrt added the type/improve Something existing is made better, does not affect the interface (example: better error message) label Dec 8, 2019
@jasonkuhrt
Copy link
Member Author

jasonkuhrt commented Dec 8, 2019

Alternate names to configure:

app.server.settings({ port: '1234' })
app.server.addToSettings({ port: '1234' })
app.server.changeSettings({ port: '1234' })
app.server.setSettings({ port: '1234' })
app.server.setConfiguration({ port: '1234' })
app.server.settings.add({ port: '1234' })

Stream of consciousness start

Considering we want an additive API (multiple calls valid, merging intuitively), something like addToSettings maybe stands out. It would also align with feedback from @schickling about the context api name:

from:

app.addContext({ ... })

to:

app.addToContext({ ... })

But come to think of it, whereas ANYTHING can be added to context, the api for server is about settings, static and predetermined by the framework (and also maybe plugins, in the future), not just raw data build up like the context api.

So never mind...

Stream of consciousness end


More brainstorming

app.server.settings.add({ port: '1234' })
app.server.settings.merge({ port: '1234' })
Object.assign(app.server.settings, {
  // ...
})
app.server.settings.set('port', 1234)
app.server.set('port', 1234)
...

This was referenced Jan 17, 2020
@jasonkuhrt jasonkuhrt added type/feat Add a new capability or enhance an existing one scope/server Related to the server component labels Jan 17, 2020
@Weakky
Copy link
Collaborator

Weakky commented Feb 4, 2020

Server setting API is now handled on settings.change({ server: { ... } }). Should we close? cc @jasonkuhrt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/server Related to the server component type/feat Add a new capability or enhance an existing one type/improve Something existing is made better, does not affect the interface (example: better error message)
Projects
None yet
Development

No branches or pull requests

2 participants