-
Notifications
You must be signed in to change notification settings - Fork 194
Glue and HTML views #136
Comments
First thanks that these lessons are back again. Now the first question : Are these (https://github.com/hapijs/glue/tree/master/test) good examples how to test things with glue and lab. I have to rewrite all the former test now :( Roelof |
second question: why can the plugin not be found here :
|
I try to test if a server is started. |
How do I start the server. Do I need to add the whole part after starting the server to start.js ? |
no due date ?? |
@roelof1967 For the test examples, you'd better go to a repo utilizing glue rather than the Glue repo itself. See e.g. aqua In the plugins object of the manifest, each key should be the name of the target module if it's a npm module, or the relative path to it if the module is internal to the app. That's how Glue requires them before calling register. var manifest = {
connections: [
{
port: 5000
}
],
plugins: {
"./version": {} //the actual key depends on where you put your plugin and which folder you decide to use as relative root. Relative root is given as an option to the compose function.
}
} To be able to start the server and aim for minimal refactoring, you can keep a structure very similar to what we already have, e.g. just changing the init function in index.js to take manifest and glueOptions as params, replacing the |
oke, so I schould not use the whole export.compose thing of the example which were pointed for a example manifest ? |
The example pointed at was more for the format of the manifest. The export.compose is the actual compose function you use from Glue (and you'll have to use it). You can check at the index.js and server.js from aqua for something closer to what we aim for. |
oke, I have now this : https://github.com/roelof1967/university and still not working :( |
@roelof1967 I made a quick example with server starting via npm start and plugin functionality kept (tests not updated yet). You may check lib/index.js and lib/start.js on this branch https://github.com/FennNaten/hueniversity/tree/assignment/glue-and-html-views if you're stuck. |
@FennNaten thanks, now the next problem. Making the test green |
@FennNaten Thank you for putting up the example :-) |
I have this test :
But now I see this error message : function is not a object. What went wrong this time ? Roelof |
and when I do this :
I get a message that private is already registered. There is something wrong with the home but I do not see it. |
@roelof1967 it would probably be better for everyone if you keep the discussion about your own submission within your pull request. This is a lot of noise here which makes it hard for people to participate and keep track of what is going on. Also, a lot of this would be better done in the gitter room for this repo. |
oke, I will do it that way |
* Summarized communication with @FennNaten from: * Assignment5 outmoded/university#136 * and his PR outmoded/university#137 * Plus, added clarifiction made in gitter by @nlf
We transitioned to hapijs university.
For details about this change see:
Let's keep our project going! This is community learning which means much of the learning will be
horizontal and not just vertical! Make your contribution, ask questions, give advice (review others code) , share your thoughts about our project's direction and let's push each other to keep growing :-)
The Assignment
Glue should be used to load "version" and "private" plugins.
Here is a helpful resource from the Glue project: Sample Manifest JSON object .
the root path of the application. For now, just make html pages for view files (no .hbs files).
When viewed in a browser, the home.html template should display the path to this view file from the root of our project.
the other called "version", and one called "private". Each point is located in it's own plugin
which glue composes when the server starts up.
"BSD-3-Clause"
valuehapi-auth-basic plugin is registered.
Glue will reference this file in the manifest file to load the plugin.
But, I encourage everyone to try it. Doing this exercise will help you get to know Glue and hapijs' auth plugin design better ;-)
If you get stuck here, we will work together to make it work!
Assignment Due May 30th
What is coming next?
Cheers!
The text was updated successfully, but these errors were encountered: