Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

Readme lacking information #1

Open
newswim opened this issue Mar 2, 2017 · 3 comments
Open

Readme lacking information #1

newswim opened this issue Mar 2, 2017 · 3 comments

Comments

@newswim
Copy link

newswim commented Mar 2, 2017

Hi,

I think that I want to use this package.. but the instructions are kind of confusing. From the current readme:

var server = new Hapi.Server();

// ... usual stuff

var configOptions = {
  secrets: ['secret', 'secret2']
};

server.register(
  {
    register: ProtectApiPlugin.plugin,
    options: pluginOptions
  },
  function (err, done) {
    if (err) {
      throw err;
    }

    server.start(done);
  }
);

I have a couple questions:

  1. Why are configOptions options defined but not passed in?
  2. Why is there a done function passed to server.start?
  3. Are there are any actual options that can be passed in or is it just an array of acceptable secrets?

Thanks! In the mean time I guess I'll try it out, but if you don't mind answer, that would be greatly appreciated.

@justin-lovell
Copy link
Owner

Hello Dan,

Thanks for taking the time to open up the first issue for this repo.

As to answers to your questions, here are my answers.

(1) You are right - that was a typo and should have been passed in as presumed.

(2) The server.start is the mechanism of starting a Hapi server with stock standard connections defined. This highlights that I should perhaps extend the README to incorporate more of the Hapi Quick Start sample to demonstrate how to inject a module into the Hapi.

(3) Right now, it is an array of acceptable secrets. I do have some time this weekend to expand on those options - e.g. options to look at HTTP headers, query strings, or cookies?

I will keep you updated on the implementation of the above.

Thanks again for taking the time to open an issue.

@newswim
Copy link
Author

newswim commented Mar 4, 2017

Awesome! Thanks for responding and clarifying those issues, that will be a big help for myself and others. Very appreciated!

@justin-lovell
Copy link
Owner

Hey @newswim , I've just updated the repo with a few extra options and a more detailed README. Your feedback would be welcomed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants