PatriciaBethBarker / Final_Project

Final Advanced JS Project - Blog
0 stars 0 forks source link

index.js #1

Open PatriciaBethBarker opened 9 years ago

PatriciaBethBarker commented 9 years ago

I have an error I do not understand. Can you help?

thomaswilburn commented 9 years ago

Maybe. What's the error?

PatriciaBethBarker commented 9 years ago

index-error

thomaswilburn commented 9 years ago

You have a mismatched punctuation--a missing brace or parentheses. In this case, it looks to me like you didn't correctly close the function call that starts on line 18.

PatriciaBethBarker commented 9 years ago

replaced models/blog.js with post.js because I was getting confused. I dded moment in my post.js and this happened.

thomaswilburn commented 9 years ago

Okay, I don't think this is related to your models, though. It's an error after you added the hapi auth cookie plugin.

PatriciaBethBarker commented 9 years ago

error-async

PatriciaBethBarker commented 9 years ago

I have the async required int he db.js file. Should I move that to the index.js?

thomaswilburn commented 9 years ago

You shouldn't move it, but you may need to add it. You need to require async into any module that uses it--just loading it in one file doesn't make it available in others.

PatriciaBethBarker commented 9 years ago

asyncloaded

thomaswilburn commented 9 years ago

Don't use the -g flag, that means you're listing global packages. async should be installed locally.

PatriciaBethBarker commented 9 years ago

grrrrrrrrrrrrrr, so do I have to uninstall ?

thomaswilburn commented 9 years ago

No, not at all. You can check to see if it's installed locally with npm list --depth=0, which will only show top-level packages in your directory.

PatriciaBethBarker commented 9 years ago

list-of-npm

thomaswilburn commented 9 years ago

Looks like you do need to install it locally. Don't forget to save it to your package: npm install async --save.

PatriciaBethBarker commented 9 years ago

OK I removed the hapi-auth-cookie...and its looking for it now...

thomaswilburn commented 9 years ago

Why remove it? Extraneous means that it is installed, but not saved to your package. It doesn't mean you don't need it.

PatriciaBethBarker commented 9 years ago

hatecookiesecret

PatriciaBethBarker commented 9 years ago

it doesn't like my cookie secret. I am really frstrrated....

thomaswilburn commented 9 years ago

No, it doesn't like the dash that's at the start of the line. That's why it has a little ^ pointing to it from beneath.

PatriciaBethBarker commented 9 years ago

Hates my code ;) hates-my-code

thomaswilburn commented 9 years ago

Well, it says "cannot add auth.scheme without a connection," so the logical answer is to move your server.connection() call up to above the server.register code.