{"id":24087137,"url":"https://github.com/hapipal/hecks","last_synced_at":"2025-05-05T17:59:17.106Z","repository":{"id":55119140,"uuid":"84032885","full_name":"hapipal/hecks","owner":"hapipal","description":"Mount your express app onto your hapi server, aw heck!","archived":false,"fork":false,"pushed_at":"2021-04-12T03:52:24.000Z","size":31,"stargazers_count":30,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-27T16:02:42.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hapipal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-06T05:20:24.000Z","updated_at":"2024-12-15T18:09:12.000Z","dependencies_parsed_at":"2022-08-14T12:31:21.972Z","dependency_job_id":null,"html_url":"https://github.com/hapipal/hecks","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapipal%2Fhecks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapipal%2Fhecks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapipal%2Fhecks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hapipal%2Fhecks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hapipal","download_url":"https://codeload.github.com/hapipal/hecks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252548767,"owners_count":21766242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-10T03:02:30.024Z","updated_at":"2025-05-05T17:59:17.054Z","avatar_url":"https://github.com/hapipal.png","language":"JavaScript","readme":"# hecks\nMount your express app onto your hapi server, aw heck!\n\n[![Build Status](https://travis-ci.com/hapipal/hecks.svg?branch=master)](https://travis-ci.com/hapipal/hecks) [![Coverage Status](https://coveralls.io/repos/hapipal/hecks/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/hapipal/hecks?branch=master)\n\nLead Maintainer - [Devin Ivy](https://github.com/devinivy)\n\n## Installation\n```sh\nnpm install @hapipal/hecks\n```\n\n## Usage\n\u003e See also the [API Reference](API.md)\n\u003e\n\u003e Hecks is intended for use with hapi v19+ and nodejs v12+ (see v2 for lower support).\n\nHecks allows you to seamlessly incorporate express applications into a hapi server.  This is particularly useful for testing an express server using [`server.inject()`](https://github.com/hapijs/hapi/blob/master/API.md#server.inject()), for unifying deployment of existing express and hapi applications, and as an initial stepping stone in migrating an express application to hapi.\n\n```js\nconst Express = require('express');\nconst BodyParser = require('body-parser');\nconst Hapi = require('@hapi/hapi');\nconst Hecks = require('@hapipal/hecks');\n\n(async () =\u003e {\n\n    const app = Express();\n\n    app.post('/user', BodyParser.json(), (req, res) =\u003e {\n\n        const user = { ...req.body };\n        user.saved = true;\n\n        res.json(user);\n    });\n\n    const server = Hapi.server();\n\n    await server.register([\n        Hecks.toPlugin(app, 'my-express-app')\n    ]);\n\n    const { result } = await server.inject({\n        method: 'post',\n        url: '/user',\n        payload: { name: 'Bill', faveFood: 'cactus' }\n    });\n\n    console.log(result); // {\"name\":\"Bill\",\"faveFood\":\"cactus\",\"saved\":true}\n})();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhapipal%2Fhecks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhapipal%2Fhecks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhapipal%2Fhecks/lists"}