Home > Web Front-end > JS Tutorial > body text

Node.js server-side application development framework -- Hapi.js_node.js

WBOY
Release: 2016-05-16 16:40:57
Original
2050 people have browsed it

Hapi.js is a rich framework for building Node.js-based applications and services, allowing developers to focus on portable and reusable application logic rather than building architecture. Built-in input validation, caching, authentication, and other features commonly used in web application development.

Sample code:

var Hapi = require('hapi');

// Create a server with a host and port
var server = new Hapi.Server('localhost', 8000);

// Add the route
server.route({
 method: 'GET',
 path: '/hello',
 handler: function (request, reply) {

 reply('hello world');
 }
});

// Start the server
server.start();
Copy after login

Attach the github address https://github.com/spumko/hapi

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template