All Projects → teknosains → hapi-project

teknosains / hapi-project

Licence: other
Sample Project of Node.js with HapiJS and Boostrap

Programming Languages

CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hapi-project

react-nes
React components for nes
Stars: ✭ 32 (+113.33%)
Mutual labels:  hapijs
hapi-cli
CLI to build API with Hapi, mongodb and mongoose. Work with Hapi V17.
Stars: ✭ 36 (+140%)
Mutual labels:  hapijs
BiB
📚 Library Management Application for Elementary Schools
Stars: ✭ 38 (+153.33%)
Mutual labels:  hapijs
hapi-now-auth
Hapi token auth for bearer and jwt
Stars: ✭ 43 (+186.67%)
Mutual labels:  hapijs
hapi-good-winston
A good reporter to send and log events with winston
Stars: ✭ 21 (+40%)
Mutual labels:  hapijs
hapi-plugin-mysql
Hapi plugin for MySQL
Stars: ✭ 17 (+13.33%)
Mutual labels:  hapijs
nodejs-tutorials-hapi
Examples for the hapi tutorial series within the Future Studio University
Stars: ✭ 70 (+366.67%)
Mutual labels:  hapijs
sapper-authentication-demo
A demonstration of Auth with Sapper + JWT + Server Side Rendering + RBAC
Stars: ✭ 102 (+580%)
Mutual labels:  hapijs
good-sentry
Sentry broadcasting for good process monitor
Stars: ✭ 15 (+0%)
Mutual labels:  hapijs
kubernetes-starterkit
A launchpad for developers to learn Kubernetes from scratch and deployment of microservices on a kubernetes cluster.
Stars: ✭ 39 (+160%)
Mutual labels:  hapijs
hapi-routes
Hapi plugin for registering routes
Stars: ✭ 12 (-20%)
Mutual labels:  hapijs
fem-instructors-api
API for Front End Masters Hapi.js Workshop
Stars: ✭ 21 (+40%)
Mutual labels:  hapijs
hano-graphql
GraphQL, Hapi and Node Project For Scaleable Apps.
Stars: ✭ 13 (-13.33%)
Mutual labels:  hapijs
Crashlyzer
Crash viewer web application for displaying the crashes reported by rn-crash-reporter components from React Native mobile applications.
Stars: ✭ 59 (+293.33%)
Mutual labels:  hapijs
hapi-moon
Hassle-free and production ready hapi.js Server boilerplate
Stars: ✭ 23 (+53.33%)
Mutual labels:  hapijs
typesafe-hapi
Typechecking for HapiJS based on Joi schemas!
Stars: ✭ 21 (+40%)
Mutual labels:  hapijs
hapio
A simple bridge plugin between HapiJS and SocketIO
Stars: ✭ 21 (+40%)
Mutual labels:  hapijs

Sample Project of Node.js with Hapi and Boostrap

What is Hapi JS ?

Its a Node.JS Framework. Read more about Hapi

Whats Included ?

We're using :

  • Handlebars template Engine
  • MongoDB or MySQL ? coming up next.....
  • Sample of Layouting
  • Module as Hapi Plugins
  • Good (plugins) for Logging
  • Have it your way...

Motivation

There's no special motivation. Its because I was asked to test the Hapi Node Framework for a Project so I created this sample.

Picture

Code Snippets

Running Server

var Hapi = require('hapi');
var server = new Hapi.Server();
var Good = require('good');
var Path = require('path');

/**
 * Lets the server run on this Host and Port
 */
server.connection({host:'127.0.0.1',port:3000});

//others code will be here.....

/**
 * running Http Node Server with Good Plugins for Logging  
 */
server.register({
	
	register : Good,
	options : {
		
		reporters : [{
			reporter : require('good-console'),
			events : {
				
				response : '*',
				log:'*'
			}
		}]
	}
	
}, function(error) {
	
	if(error) {
		
		throw error;
	}
	
	/**
	 * Starting Server
	 */
	server.start(function(){
	
		console.log("Server running on", server.info.uri);
	});
	
});

Handling Static files

/**
 * Routing Static Pages [JS, Css, Images, etc]
 */
server.register(require('inert'), function(err) {
	
	if (err) {
		
		throw err;
	}
	
	server.route({
		method : 'GET', path : '/public/{path*}', handler : {
			directory : {
				path : './public',
				listing : false,
				index : false
			}
		}
	});
	
});

Hapi Basic Route

/**
* Default route
*/
server.route({
	
    method: 'GET',
    path: '/',
    handler: function (request, reply) {
		
        reply('Hello, world!');
    }
});

Installation

Just Clone it to your local machine and get inside the Project root

Install Dependecy modules

npm install

node server.js

Open in your browser

http://127.0.0.1:3000

Tutorial

Sample Project of Node.js with Hapi and Boostrap

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].