I'm new to both Node and Hapi.js, but not to programming.
I've made a few simple Hapi.js servers, just for testing out Joi and other plugins.
I'm now trying to understand how best to package up chunks of functionality in a Hapi way, so we can re-use them in future projects and potentially share them with the world!
Are there any good resources for learning this available?
EDIT:
I've found a few good resources, but non which go into deep details about the plugin system.
https://github.com/hapijs/hapi/issues/1489 - Getting Started Tutorial Contest
https://github.com/otodockal/hapi-tutorial - Entry in above contest, with a section on plugins
I've made a sample project which groups functionality into plugins which might be what you're looking for:
https://github.com/johnbrett/hapi-level-sample
If you're looking at sharing functionality between plugins, look at the usage of plugin.expose, plugin.depend.
If you have any questions on it, you can raise an issue on the github project.
The latest hapijs.com website has a good intro as well: http://hapijs.com/tutorials/plugins
For some additional detail about hapi plugins (and hapi in general), see the following:
Developing a hapi Edge: A Rich Node.JS Framework for Apps and Services - This book is available now (also from Amazon), and has a chapter on how to create a plugin in hapi.
Matt Harrison's upcoming hapi.js in Action - This book is available currently in "MEAP" (Manning Early Access Program), and will soon (?) have a chapter available on plugins ("Building modular applications with Plugins").
hapi plugin search engine
Getting Started with hapi.js by John Brett also has a chapter on creating and using plugins.
Edit 2015-10-04: The chapter "Building modular applications with Plugins" in Matt Harrison's above mentioned book is now available in the MEAP edition.
Related
I have been working with migrations of applications from WAS 8.5.5 to WAS 9 Liberty Server. Is there anyone who can confirm what requirements must be met?
My application is built in Java 6 - what kind of other technologies do I need for migration?
IBM provides a collection of articles that talk about the basics of migrating applications to Liberty. These pages include links to tools meant to scan the environment and identify the changes needed to make applications compatible with Liberty and produce sample server configuration.
I'd suggest you read through these and see if they answer your basic questions, and then you can post more specific questions if you need to.
I would like to integrate OpenAPI 3 into my node.js project and take advantage of the Swagger tools that are available.
I noticed that the swagger npm module hasn't been updated in five years. There are other questions, such as this one (How to use OpenAPI 3.0 in Node.js?) which have basically gone unanswered.
A superficial web search yields me no results.
Does anyone have some ideas/suggestions on how to implement the OpenAPI 3.* standard into swagger apps in node? Even if you've found a tutorial or some description on how to do this manually, I would be most grateful for some direction and advice.
I tried just simply putting the OpenAPI 3 standard in the editor (swagger project edit) as you would the online editor, and it goes crazy with errors. I tried manually updating the swagger.yaml document, which also just leads to the node application crashing.
The updates from the new standard (3.* vs 2) are so much easier to read, implement and reuse, which is why I'm asking about this. Again, any direction or help would be greatly appreciated.
Swagger changed its name to OpenAPI starting with version 3.0 back in 2017. The company that originally created the Swagger standard (Smartbear) now uses the Swagger name for its own tooling, while the open standard goes by OpenAPI. This is why you're not seeing many tools that use the name Swagger.
Node.js is a very popular language, so there is an abundance of tooling available for OpenAPI 3.0. In the future, use the term "OpenAPI" when searching, and you'll get better results.
The popular site https://openapi.tools/ has a wide assortment of popular tools available that utilize OpenAPI, along with a list of what languages each tool uses. This is a great starting point, though there are many other tools out there.
Its really confusing to setup the best project structure for node.js
I'm developing node.js application that works on Browser, Mobile and Desktop.
This application has many modules like billing, support, dashboard etc..
I started with express.js MVC pattern, later Sails.js looked very attractive.
Then came across MEAN Stack and finally landed on Microservices Seneca.js
Micro-Services looks like what i needed, But i see that Sails.js don't support it.
I wanted to use Aerospike NoSQL, but waterline orm doesn't support it right now.
So what is the project structure solution you are using for node.js that works in Browser, Mobile and Desktop?
This is an highly subjective question. But Meteor is what you are looking for. It does support desktop, browser, mobile, etc. and encourage NoSQL by it's native MongoDB support.
As a reference, I personally did try every single one of the frameworks you have tested (Sails, MEAN, etc.) and ended up with Meteor as my preferred.
As for the project structure, you can read more on various tutorials, books and YouTube videos. The learning curve is steep, but the community behind the project is quite alive and helpful.
I work full time in a PHP and JavaScript team but we are looking at a new technology to adopt. We want to dive into node.js however we all want to get the same book but we have no idea which would be the best.
Any recommendations ?
Also links would be good.
Regards
Oliver
There are no real - like in actual wood - books out yet, Yahoo! Press has one in the works though, title will be "Up and Running With Node.js".
Right now there's a community driven e-Book from the makers of the express.js framework, its source code is also available on GitHub.
If you like videos, then should check out a couple of talks by Node's creator Ryan Dahl:
Introducion to Node.js - YUI Theater (May 2010)
GoogleTeckTalk - JavaScript on the Server (July 2010)
Techniques for a single stack world - JSConf.eu (Sep 2010)
You can find even more links on our tag wiki.
PS: Best thing IMO is to start a little side project and use that to explore Node.js.
I've been using CakaPHP and Kohanaphp but now I want to try out other frameworks from a more sophisticated OOP language for my next projects.
How can I learn the following frameworks quickly so I can immediately pick what to use:
Pylons
Sinatra
Ramaze
Tutorials and examples from online resources would really be great.
For php developers who've already underwent this learning experience, please share yours.
Thanks
Regarding Pylons. There is a good introductory book written by one of the creators of Pylons. It is freely available online at http://pylonsbook.com/
For Ramaze, see:
the website
the wiki
the book
the mailing list
the IRC channel
You can also learn about setting up Sinatra with Google's App Engine (via jRuby) here: http://code.google.com/p/appengine-jruby/
Fairly quick and easy setup.
There's also this screencast at PeepCode https://peepcode.com/products/sinatra