{"_id":"falcor-hapi","_rev":"27-8bd685b0c0902aea87931ad1770b511c","name":"falcor-hapi","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.2":{"name":"falcor-hapi","version":"0.0.2","author":{"url":"https://github.com/Netflix/falcor-hapi/authors.txt","name":"Netflix"},"_id":"falcor-hapi@0.0.2","maintainers":[{"name":"michael.paulson","email":"michael.b.paulson@gmail.com"}],"homepage":"https://github.com/Netflix/falcor-hapi","bugs":{"url":"https://github.com/Netflix/falcor-hapi/issues"},"dist":{"shasum":"60c3455dd57525fff55fe92243688e985436978b","tarball":"https://registry.npmjs.org/falcor-hapi/-/falcor-hapi-0.0.2.tgz","integrity":"sha512-H4omTIc1o2T6kQ+/CsSpEzyLvtdmP1sznPpTarJTQidhhbS3eTLWRLL0ek9i/HeaQX3G1Si9aioIShOv4oSzBg==","signatures":[{"sig":"MEYCIQCpcwnx5WgjXD4qU8qzM4aULUtEwZAr+cmqmna9vInkDgIhAJprELtUE+9X0h7rpKBLLW8iLJddyI+jPoeKQ1G1u9eJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"src/index.js","_from":".","_shasum":"60c3455dd57525fff55fe92243688e985436978b","gitHead":"4782828248453bf61991264feb0cf9ab22b6f465","scripts":{"lint":"node ./node_modules/.bin/eslint src/"},"_npmUser":{"name":"michael.paulson","email":"michael.b.paulson@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache License, Version 2.0"}],"repository":{"url":"git+https://github.com/Netflix/falcor-hapi.git","type":"git"},"_npmVersion":"2.8.4","description":"A falcor server for hapi.","directories":{},"_nodeVersion":"0.10.24","dependencies":{"rx":"~2.3.24","joi":"^6.5.0","boom":"^2.7.1","falcor-router":"^0.2.8"},"devDependencies":{"eslint":"^0.21.0"}},"0.0.3":{"name":"falcor-hapi","version":"0.0.3","author":{"url":"https://github.com/Netflix/falcor-hapi/authors.txt","name":"Netflix"},"_id":"falcor-hapi@0.0.3","maintainers":[{"name":"michael.paulson","email":"michael.b.paulson@gmail.com"},{"name":"netflix","email":"aliu@netflix.com"},{"name":"satyend","email":"satyend@netflix.com"}],"homepage":"https://github.com/Netflix/falcor-hapi","bugs":{"url":"https://github.com/Netflix/falcor-hapi/issues"},"dist":{"shasum":"a4dd31d8323bbc6897746afa13c40e96e019b5ad","tarball":"https://registry.npmjs.org/falcor-hapi/-/falcor-hapi-0.0.3.tgz","integrity":"sha512-X1ECurJIRNkX3FpGK62+yfPCYQE1oz6cvvqps9mNf+T7rwD/hH+xxUFF0OPaBdXDq3vth2D+u8FUZI1tVZHbrg==","signatures":[{"sig":"MEUCIQD8Cg1ooVrITyWfxmxPD5aDgW6LBoH3Tz7yXjaIQrwwJgIgBEN/wO3yQ7+V3l/TzIzN+fEgu42BH6+0ukR+QNJqCHo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"src/index.js","_from":".","_shasum":"a4dd31d8323bbc6897746afa13c40e96e019b5ad","gitHead":"532b2d2dde24a6fecfd19a927c98a0d3c7c9da8c","scripts":{"lint":"node ./node_modules/.bin/eslint src/"},"_npmUser":{"name":"michael.paulson","email":"michael.b.paulson@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache License, Version 2.0"}],"repository":{"url":"git+https://github.com/Netflix/falcor-hapi.git","type":"git"},"_npmVersion":"3.3.12","description":"A falcor server for hapi.","directories":{},"_nodeVersion":"5.1.1","dependencies":{"rx":"~2.3.24","joi":"^6.5.0","boom":"^2.7.1","falcor-router":"^0.2.8"},"devDependencies":{"eslint":"^0.21.0"}}},"time":{"created":"2015-08-18T03:44:03.153Z","modified":"2025-11-26T16:39:45.752Z","0.0.2":"2015-08-18T03:44:03.153Z","0.0.3":"2016-01-15T15:19:43.497Z"},"bugs":{"url":"https://github.com/Netflix/falcor-hapi/issues"},"author":{"url":"https://github.com/Netflix/falcor-hapi/authors.txt","name":"Netflix"},"homepage":"https://github.com/Netflix/falcor-hapi","repository":{"url":"git+https://github.com/Netflix/falcor-hapi.git","type":"git"},"description":"A falcor server for hapi.","maintainers":[{"email":"npm@netflix.com","name":"barb_the_builder"},{"email":"satyend@netflix.com","name":"satyend"}],"readme":"# falcor-hapi\nServer middleware for falcor-hapi\n\nWorking usage example of the basic repro in falcor-hapi-demo/\n\n## Usage\nMinimalistic example\n\n```\nvar FalcorServer = require('falcor-hapi');\nvar Hapi = require('hapi');\nvar TestRouter = <your router here>;\n\nvar app = new Hapi.Server();\napp.connection({\n    host: \"localhost\",\n    port: 9090\n});\n\napp.route({\n    method: ['GET', 'POST'],\n    path: '/model.json',\n    handler: FalcorServer.dataSourceRoute(function(req, res) {\n        return new TestRouter();\n    })\n});\napp.start();\n```\n\n## Hapi Plugin Usage\nYou can also register this module as an Hapi Plugin and use its provided Falcor handler.\n\n#### Features\n\n * Provides restful router with cached routes out of the box.\n * Both the Hapi Request and Reply are available within your routes as `this.req` and `this.reply`.\n * Validates your routes with JOI.\n * You can provide your own initialize method to the router.\n * Alternately, you can provide your own Router class and the handler will mixin the logic to cache your routes and the base Falcor router class.\n\n ```\n var Hapi = require('hapi');\n\n var app = new Hapi.Server();\n app.connection({\n     host: \"localhost\",\n     port: 9090\n });\n\n app.register(require('falcor-hapi'), function (err) {\n    if (err) {\n        console.error('Failed to load plugin:', err);\n    }\n\n    app.route({\n      method: ['GET', 'POST'],\n      path: '/model.json',\n      handler: {\n          falcor: {\n              routes: routes,                                         // Your routes\n              cacheRoutes: true,                                      // Whether to cache your routes, default to true\n              options: {debug: true},                                 // Option to give to Falcor router\n              initialize: function() {                                // Optional initialize method\n                 this.foo = this.req.payload.meaningoflife || 42;\n              },\n              routerClass: MyRouterClass                              // Optional routerClass to use\n          }\n      }\n    });\n\n    app.start();\n});\n```\n\n## Development\nPlease run linting before pushing on repo\n```\nnpm run lint\n```\n\n## Todo\n * Create mocha test for regression and development instead of using example\n","readmeFilename":"README.md"}