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

Allow API to take options array #612

Open
HakS opened this issue Mar 25, 2019 · 2 comments
Open

Allow API to take options array #612

HakS opened this issue Mar 25, 2019 · 2 comments

Comments

@HakS
Copy link
Contributor

HakS commented Mar 25, 2019

I can't figure out how to use KalaStatic in a node script, it says it needs a path in the parameter like thi KalaStatic('path/to/site'), however this wouldn't work, since in the source it accepts something like an object, which has a method defaults(), and I can't find anything about how to build this object this KalaStatic function expects.

@RobLoach
Copy link
Contributor

Hmm, should update those docs. It currently takes an nconf object to allow multiple config locations.

const Kalastatic = require('kalastatic')
const nconf = require('nconf')

nconf.file('config.json')

const kstat = Kalastatic(nconf)
kstat.build().then(function () {
  console.log("DONE!")
})

We could make it take an options array, or a base path, instead. Might make it easier to set up on the API side.

@HakS
Copy link
Contributor Author

HakS commented Mar 25, 2019

That's a good idea! Other thing that might work would be to look for a config file in the root of the node script being perhaps? load this config and send it to Kalastatic

But I guess that's another ticket

@RobLoach RobLoach changed the title Improve documentation for Kalastatic API Allow API to take options array Apr 30, 2019
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

No branches or pull requests

2 participants