{"id":20678785,"url":"https://github.com/olistic/hapi-overriding","last_synced_at":"2026-04-27T03:32:05.283Z","repository":{"id":29745081,"uuid":"33288609","full_name":"olistic/hapi-overriding","owner":"olistic","description":"Override HTTP verbs","archived":false,"fork":false,"pushed_at":"2015-05-14T02:52:05.000Z","size":184,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T15:10:14.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/olistic.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":"2015-04-02T04:09:14.000Z","updated_at":"2018-04-03T23:18:09.000Z","dependencies_parsed_at":"2022-09-06T20:50:48.864Z","dependency_job_id":null,"html_url":"https://github.com/olistic/hapi-overriding","commit_stats":null,"previous_names":["moliveraf/hapi-overriding"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/olistic/hapi-overriding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olistic%2Fhapi-overriding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olistic%2Fhapi-overriding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olistic%2Fhapi-overriding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olistic%2Fhapi-overriding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olistic","download_url":"https://codeload.github.com/olistic/hapi-overriding/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olistic%2Fhapi-overriding/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32321426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-16T21:22:15.267Z","updated_at":"2026-04-27T03:32:05.267Z","avatar_url":"https://github.com/olistic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hapi-overriding\n\n**hapi-overriding** is a [hapi](https://github.com/hapijs/hapi) plugin that allows you to override the method of an incoming request, using HTTP verbs such as PUT and DELETE in places where the client doesn't support it. This package was inspired in [hapi-method-override](https://github.com/ubaltaci/hapi-method-override).\n\n[![Build Status](https://travis-ci.org/olistic/hapi-overriding.svg?branch=v0.1.4)](https://travis-ci.org/olistic/hapi-overriding)\n[![Coverage Status](https://coveralls.io/repos/moliveraf/hapi-overriding/badge.svg?branch=master)](https://coveralls.io/r/moliveraf/hapi-overriding?branch=master)\n\n## Install\n\n```sh\n$ npm install hapi-overriding\n```\n\n## Usage\n\n**hapi-overriding** works by extending the `onRequest` step of the request lifecycle. The extension function checks, for any incoming POST request, if the path ends with one of the defined action names (e.g. `destroy`). If so, it will change the method to the corresponding HTTP verb (e.g. `DELETE`). It will also change the url of the request, removing the action part and keeping your routes clean.\n\n## Example\n\nClient-side:\n```html\n\u003cform method=\"POST\" action=\"/users/507f1f77bcf86cd799439011/destroy\"\u003e\n  \u003cbutton type=\"submit\"\u003eDelete user\u003c/button\u003e\n\u003c/form\u003e\n```\n\nServer-side:\n```javascript\nvar Hapi = require('hapi');\nvar server = new Hapi.Server();\n\nserver.connection({ port: 3000 });\n\nserver.register(require('hapi-overriding'), function(err) {\n\n  if (err) {\n    throw err;\n  }\n\n  server.route({\n    method: 'DELETE',\n    path: '/users/{id}',    // No `/destroy` at the end!\n    handler: function (request, reply) { ... }\n  });\n\n  server.start();\n});\n```\n\n## Options\n\nThe action names may be customized by passing the following options when registering the plugin:\n\n- `put` - the action that represents the PUT verb. Defaults to `update`.\n- `delete` - the action that represents the DELETE verb. Defaults to `destroy`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folistic%2Fhapi-overriding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folistic%2Fhapi-overriding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folistic%2Fhapi-overriding/lists"}