Hapi.js 是一個用來構建基于 Node.js 的應用和服務的富框架,使得開發者把重點放在便攜可重用的應用邏輯而不是構建架構。內建輸入驗證、緩存、認證和其他 Web 應用開發常用的功能。
示例代碼:
var Hapi = require('hapi');// Create a server with a host and portvar server = new Hapi.Server('localhost', 8000);// Add the routeserver.route({ method: 'GET', path: '/hello', handler: function (request, reply) { reply('hello world'); }});// Start the serverserver.start();
附上github地址 https://github.com/spumko/hapi
新聞熱點
疑難解答